mirror of
https://github.com/tiimgreen/github-cheat-sheet.git
synced 2025-08-13 19:34:00 +02:00
Improve syntax highlighting section
This commit is contained in:
15
README.md
15
README.md
@@ -95,11 +95,18 @@ If you want to link to another issue in the same repo, simple type hash `#` then
|
|||||||
|
|
||||||
To link to an issue in another repo, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`.
|
To link to an issue in another repo, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`.
|
||||||
|
|
||||||
## Syntax Highlighting in README
|
## Syntax Highlighting in Markdown Files
|
||||||
|
|
||||||
To add syntax highlighting to code in README:
|
For example, to syntax highlight Ruby code in your Markdown files write:
|
||||||
|
|
||||||

|
```ruby
|
||||||
|
require 'tabbit'
|
||||||
|
table = Tabbit.new('Name', 'Email')
|
||||||
|
table.add_row('Tim Green', 'tiimgreen@gmail.com')
|
||||||
|
puts table.to_s
|
||||||
|
```
|
||||||
|
|
||||||
|
This will produce:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
require 'tabbit'
|
require 'tabbit'
|
||||||
@@ -108,6 +115,8 @@ table.add_row('Tim Green', 'tiimgreen@gmail.com')
|
|||||||
puts table.to_s
|
puts table.to_s
|
||||||
```
|
```
|
||||||
|
|
||||||
|
GitHub uses [Linguist](https://github.com/github/linguist) to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing the [languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
|
||||||
|
|
||||||
## Commit History by Author
|
## Commit History by Author
|
||||||
|
|
||||||
To view all commits on a repo by author add `?author=username` to the URL.
|
To view all commits on a repo by author add `?author=username` to the URL.
|
||||||
|
Reference in New Issue
Block a user