GitHub Markdown
Overview of the Markdown rendering on GitHub.
Headings
You can use up to up to six levels by writing # at the start of a line. The number of hashtags defines the hierarchy of the heading. The first two headings render with a horizontal separator.
# First level
## Second level
### Third level
#### Fourth level
##### Fifth level
###### Sixth levelLinking to Headings
In Markdown documents, each heading has its name as the identifier which you can link to via a fragment.
[link to](#linking-to-headings)Emphasize
Emphasize text with different meanings.
Bold
Use double astersik or double underscore before and after text to denote bold.
**bold**
__bold__Italic
Use single asterisk or underscore before and after text to denote italic.
*italic*
_italic_Strikethrough
Use double tildes before and after text to strikethrough.
~~strikethrough~~Paragraphs
Use a blank line to separate one or more lines of text.
a paragraph
anoter paragraphLine Breaks
Use a backslash or two or more spaces at the and of a line, then type return to define a line break.
test line\
test lineCode
Inline Code Block
Use a backtick before and after text to denote as inline code.
`code`Fenced Code Block
Use three backticks in a separate line before and after code or add at least four spaces to the start of a line.
```
code
``` codeSyntax Highlighting
Add syntax highlighting by specifying a language next to the backticks before a fenced code block.
```javascript
function markdownRocks() {
return true
}
```Escaping Backticks
Inline code blocks can be escaped using double backticks. Fenced code blocks using backticks can be escaped using three tildes ~~~ or four backticks ````.
Blockquotes
Add a greater-than sign in front of a paragraph.
To create a blockquote.
> a quoted pragraph
>
> another quoted paragraphNested Blockquotes
Add two greater-than signs in front of the paragraph you want to nest.
a quoted paragraph
a quoted paragraph inside a quotation
> a quoted paragraph
>> a quoted paragraph inside a quotationLists
Numbered List
Add a figure followed by period, then a space and your content for each line item. The figure of the first item defines the sequence, figures of the following lines won't be considered.
- numbered list item
- numbered list item
- numbered list item
1. numbered list item
2. numbered list item
3. numbered list itemBulleted Lists
Add an asterisk, dash or plus sign followed by period, then a space and your content for each line item.
- bulleted list item
- bulleted list item
- bulleted list item
* bulleted list item
* bulleted list item
* bulleted list itemTask Lists
Add a dash followed by a space, then brackets ==with a space in between==, then another space and your content for each task.
- Unfinished task list item
- Finished task list item
- [ ] Unfinished task list item
- [x] Finished task list itemNesting Lists
Add two spaces to indent a list item and another two spaces for every next level. You can use up to ten levels. Mixing numbered and bulleted lists is possible.
- first level
- second level
* first level
* second level
1. first level
1. second level
* first level unordered list item
1. second level ordered list itemLinks
Add the text in brackets, then add the path or URL in parentheses.
[this is a link](http://github.com/)Images
Add an exclamation mark, followed by alt text in brackets, and the path or URL to the image asset in parentheses. GitHub automatically adds a link to image leading to the image url.
For accessibility reasons, make sure the alt text describes the image content precisely!
Linking images
Add a link to an image by enclosing the Markdown for the image in brackets, and then add the link in parentheses.
[](http://github.com/image.jpg)Specifying Theme Context
Add the dark color mode image as a fragment to the url.
Footnotes
Add a footnote in square brackets preceded by a caret and an identifier1. The footnote content can be added by using the before mentioned construct followed by colon and then the content.
Text with a footnote[^1].
[^1]: The footnote can be defined anywhere in the document but will be rendered at the end.Tables
Create a table by denoting each cell with pipe characters. Use three or more hyphens in the second row to create each column, this is mandatory.
| column 1 | column 2 |
|---|---|
| cell | cell |
| cell | cell |
| column 1 | column 2 |
|---|---|
| cell | cell |
| cell | cell | Alignment
Add a colon to the left, right, or on both side of the hyphens in the second row to align text of the columns accordingly.
| column 1 | column 2 | column 3 |
|---|---|---|
| left | center | right |
| left | center | right |
| column 1 | column 2 | column 3 |
|:--- | :---:| ---:|
| left | center | right |
| left | center | right |Formatting Text
You can emphasize text, add links, images and inline code blocks in tables.
Horizontal Rules
Use three or more asterisks, dashes, or underscores alone on a line.
---
***
___Footnotes
-
Identifiers can be numbers or words without spaces or tabs.
↩