A simple and practical cheat sheet for GitHub Flavored Markdown (GFM), incorporating all the main features. It is intended to be used as both a showcase and a reference.
For more information, visit John Gruber's original specification or the GFM Getting Started Guide.
- Headings
- Emphasis
- Links
- Images
- Lists
- Blockquotes
- Horizontal Rules
- Raw HTML
- Code
- Footnotes
- Tables
- Line Breaks
- Videos
- TeX
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6*I'm italic*
_Same here_ **Bold here**
__Me too__ ~~Pineapple belongs on pizza~~Feel free to try out the ~~**_combinations_**~~ [Google](https://www.google.com)
[With title](https://www.google.com "Title")[Example][reference]
Use numbers to reference links like [1]
Alternatively, simply use the [reference] for direct links[reference]: https://www.example.com
[1]: https://www.example.com [Link to the repository's license file](./LICENSE)http://www.example.com or <http://www.example.com> for direct links.
Sometimes, example.com works too (this behavior may differ depending on the renderer, such as GFM) has been used to convey the concept of a space (" ") in some examples to ensure clarity
* Asterisks
- Minuses
+ Pluses1. Item one
2. Item two
3. Item three1. Item one
···2. Item two
······- Item three
- Item four
···- Item five
······6. Item six1. Item one
···You can add properly indented paragraphs within list items
···Notice the blank line above, and the leading spaces- Item two
···To create a line break without starting a new paragraph, add two trailing spaces··
···This line is separate but still part of the same paragraphNote
Blockquote styling is not part of the original Markdown spec. However, they're supported in GitHub Flavored Markdown (GFM)
> This is a simple blockquote
> This is the second line
>> This is a nested blockquote> [!NOTE]
> This is a styled blockquote, a note
> [!TIP]
> This is a really cool tip
> [!IMPORTANT]
> This is a VERY important piece of text
> [!CAUTION]
> Hey, be cautious
> [!WARNING]
> This is a warningAny
***
Three
---
Of
___
These<div>
<p>Raw HTML works quite nicely in Markdown</p>
<p>However **markdown** does __not__ work inside HTML</p>
<p>Use <b>HTML</b> tags <i>instead</i></p>
</div>This is some `very` cool `inline code````javascript
const variable = "My very cool variable"
console.log(variable)
```
```
Mo language is specified here, so no syntax highlighting (varies based on renderer). But hey, let's still add a <em>tag</em> because why not
```Note
Footnotes are not part of the original Markdown spec. However, they're supported in GitHub Flavored Markdown (GFM)
Here’s a basic footnote[^1].
Footnotes can also span multiple lines[^2].
You can even name your footnotes for better organization or clarity[^note].
[^1]: This is the source or reference for the note
[^2]: To add multiple lines, simply start each new line with 2 spaces
This makes it easy to create footnotes with more detailed information
[^note]: Named footnotes, like this one, will still display with numbers, but they offer easier identification and linking
Notice the 4-space indentation for the new lines, which is a different syntax option.Note
Tables are not part of the original Markdown spec. However, they're supported in GitHub Flavored Markdown (GFM)
| Left | Center | Right |
| :-------- | :-------: | --------: |
| Apple | Banana | $1.00 |
| Orange | Melon | $0.75 |Markdown | Not | Formatted
--- | --- | ---
*Renders* | `the` | **same**
1 | 2 | 3This is the first line in the first paragraph
This is the second line in the same paragraph, separated by a single new line from the one above
This is the first line in the second paragraph, separated by two new lines from the previous line of the previous paragraph Markdown does not support videos natively. However, you can use embed a link to a video like this.
<a href="http://www.youtube.com/watch?feature=player_embedded&v=VIDEO_ID><img src="http://img.youtube.com/vi/VIDEO_ID/thumbnail.jpg" alt="Alt text" width="690" height="420" border="5"/></a>You can also use Markdown to directly embed the links. Keep in mind that this does not preserve the size or border.
[](http://www.youtube.com/watch?v=VIDEO_ID)Note
TeX math expressions are enclosed using dollar signs ($).
A full list of TeX math symbols is beyond the scope of this cheatsheet. For a more comprehensive reference, check out CodeCogs, where you can effectively experiment with equations.
Still, here are some simple examples.
$E = mc^2$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$