Markdown cheatsheet
Headers
# Header Level 1## Header Level 2### Header Level 3#### Header Level 4##### Header Level 5###### Header Level 6
H1
H2
H3
H4
H5
H6
Alternatively, for H1 and H2, an underline-ish style:
Alt-H1
Alt-H2
You can also specify header ID:
Hello {#id}-----
Hello {#id}
Emphasis
Italics (emphasis): *asterisks* or _underscores_.Bold (Strong emphasis): **asterisks** or __underscores__.Combined emphasis with **asterisks and _underscores_**.Strikethrough: ~~Scratch this.~~
Italics (emphasis): asterisks or underscores.
Bold (Strong emphasis): asterisks or underscores.
Combined emphasis with asterisks and underscores.
Strikethrough: Scratch this.
Lists
1. First ordered list item2. Another item* Unordered sub-list.1. Actual numbers don't matter, just that it's a number1. Ordered sub-list4. And another item.You can have properly indented paragraphs within list items. Notice the blankline above, and the leading spaces.* Unordered list can use asterisks- Or minuses+ Or pluses
First ordered list item
Another item
- Unordered sub-list.
Actual numbers don't matter, just that it's a number
- Ordered sub-list
And another item.
You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces.
- Unordered list can use asterisks
- Or minuses
- Or pluses
Links
[I'm an inline-style link](https://www.google.com)[I'm an inline-style link with title](https://www.google.com "Google's Homepage")[I'm a reference-style link][Arbitrary case-insensitive reference text][I'm a relative reference to a repository file](../blob/master/LICENSE)[You can use numbers for reference-style link definitions][1]Or leave it empty and use the [link text itself].URLs and URLs in angle brackets will automatically get turned into links.http://www.example.com or <http://www.example.com> and sometimesexample.com.Some text to show that the reference links can follow later.[arbitrary case-insensitive reference text]: https://www.mozilla.org[1]: http://slashdot.org[link text itself]: http://www.reddit.com
I'm an inline-style link with title
I'm a relative reference to a repository file
You can use numbers for reference-style link definitions
Or leave it empty and use the link text itself.
URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or http://www.example.com and sometimes example.com.
Some text to show that the reference links can follow later.
Images
Here's our logo (hover to see the title text):Inline-style:![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")Reference-style:![alt text][logo][logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2"
Here's our logo (hover to see the title text):
Code and syntax highlighting
Inline `code` has `back-ticks around` it.
Inline code
has back-ticks around
it.
Code blocks:
```javascriptvar s = "JavaScript syntax highlighting";alert(s);``````pythons = "Python syntax highlighting"print s``````No language indicated, so no syntax highlighting.But let's throw in a <b>tag</b>.```
var s = "JavaScript syntax highlighting";alert(s);
s = "Python syntax highlighting"print s
public static int getDate(String enum) {return null;}
No language indicated, so no syntax highlighting.But let's throw in a <b>tag</b>.
Tables
Colons can be used to align columns.| Tables | Are | Cool || ------------- |:-------------:| -----:|| col 3 is | right-aligned | $1600 || col 2 is | centered | $12 || zebra stripes | are neat | $1 |There must be at least 3 dashes separating each header cell.The outer pipes (|) are optional, and you don't need to make theraw Markdown line up prettily. You can also use inline Markdown.Markdown | Less | Pretty--- | --- | ---*Still* | `renders` | **nicely**1 | 2 | 3
Colons can be used to align columns.
Tables | Are | Cool | Tables | Are | Cool |
---|---|---|---|---|---|
col 3 is | right-aligned | $1600 | col 3 is | right-aligned | $1600 |
col 2 is | centered | $12 | col 2 is | centered | $12 |
zebra stripes | are neat | $1 | zebra stripes | are neat | $1 |
There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
Markdown | Less | Pretty |
---|---|---|
Still | renders | nicely |
1 | 2 | 3 |
Blockquotes
> Blockquotes are very handy in email to emulate reply text.> This line is part of the same quote.Quote break.> This is a very long line that will still be quoted properly when it wraps.Oh boy let's keep writing to make sure this is long enough to actuallywrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.
Quote break.
This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can put Markdown into a blockquote.
Inline HTML
You can also use raw HTML in your Markdown, and it'll mostly work pretty well.
<dl><dt>Definition list</dt><dd>Is something people use sometimes.</dd><dt>Markdown in HTML</dt><dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd></dl>
Horizontal rule
Three or more...---Hyphens***Asterisks___Underscores
Three or more...
Hyphens
Asterisks
Underscores
Footnotes
Abbreviations
This is some text not written in HTML but in another language!
{:.mega-big}
Definition lists
kramdown : A Markdown-superset converter
Maruku : Another Markdown-superset converter
{:#term} Term with id="term" : {:.cls} Definition with class "cls"
{:#term1} First term {:#term2} Second term : {:.cls} Definition
EOB
- list one ^
- list two
Inline classes
This is{:.underline} some code
{:#id}{:.class}.
A link{:rel='something'} and some tools{:.tools}.%