[Syntax] highlighting
Here’s an example of how to use GitHub syntax to highlight markup:
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'}}})Copy the code
You can also simply indent the code by four Spaces:
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}
Copy the code
Task Lists Task Lists
- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete item
Copy the code
If you include a task list in the first comment of the problem, you will get a handy progress indicator in the problem list. It also works in Pull Requests!
Tables form
You can through the combination of a word list with a hyphen – divided them (for the first row), then use pipe | separate each column to create tables:
First Header | Second Header ------------ | ------------- Content from cell 1 | Content from cell 2 Content in the first column | Content in the second columnCopy the code
Would become:
First Header | Second Header |
---|---|
Content from cell 1 | Content from cell 2 |
Content in the first column | Content in the second column |
SHA references
Any reference to the committed SHA-1 hash is automatically converted to a link submitted on GitHub.
16c999e8c71134401a78d4d46435517b2271d6ac
mojombo@16c999e8c71134401a78d4d46435517b2271d6ac
mojombo/github-flavored-markdown@16c999e8c71134401a78d4d46435517b2271d6ac
Copy the code
Issue references within a repository
Any number that references a post or pull request will be automatically converted to a link.
#1
mojombo#1
mojombo/github-flavored-markdown#1
Copy the code
Username @mentions
Typing an @ symbol followed by a user name will notify that person to view the comments. This is called “@mention” because you’re referring to a person. You can also @mention teams in your organization.
Automatic linking for URLs
Any URL, such as the http://www.github.com/ link, is automatically converted to a clickable link.
Strikethrough delete
Any word with two wavy lines (such as ~~this~~) will be crossed out.
Emoji
GitHub supports emojis!
To see all the images we support, check out the Emoji Cheat Sheet.
Jump to the title anchor point
Define a # header, then use [abcd…] (# the title) to locate the anchor point
* [1 preface](#1- preface) ## 1 PrefaceCopy the code
Effect:
reference
Mastering Markdown, making Guides guides.github.com/features/ma…