Markdown Cheat Sheet

ADVERTISEMENT

Paragraphs and Line Breaks
Links
Code Block
Indent code by 4 spaces or 1 tab
Para = one or more consecutive lines
Empty lines = end of paragraph
One level indentation will be removed
This is [an example]( ) link
& and <, > are automatically HTML’ised
> 2 spaces at EoL = HTML line break
Inline
This is [example]( “Title”)
Markdown not usable in code blocks
with a title
Code Spans
This is a [reference link][id] with an id
[id]: “Title”
Use backticks around code:
`printf()`
Headers
Reference
This is a [reference link][] without an id
Use multiple backticks for literal
[reference link]: (Title)
# This is an H1
backtick:
``ls `date+%h` | wc -l``
## This is an H2
Use space if literal backtick is at
Link id can be letters, numbers, spaces, and punctuation
start of code
span:`` ` ``
###### This is an H6
Link id is case-insensitive
Alternative: ==s for H1, --s for H2
In ref links, link definition can be indented up to 3 spaces
In ref links, use parentheses, single or double quotes for title
In ref links, link URL can be surrounded by < >
In ref links, title can be on separate line with indentation
Miscellaneous
In ref links, link definitions can appear anywhere in document
Emphasis
Horizontal Rule / Line
*This is an <em>*
3 or more asterisks, hyphens or
and
_so is this_
underscores
**This is a <strong>**
and
__so is this__
Lists
List with embedded Blockquote
Use same closing marker as opening
Indent > delimiters:
Emphasis possible in middle of word
\* or \_ for a literal * or _
+ Red
Asterisks, pluses &
*
A list item with a blockquote:
Unordered
* Green
hyphens interchangeably
> This is a blockquote
- Blue
Numbers, not necessarily
1. Red
Ordered
sequential. Always start
1. Green
List with embedded Code block
Blockquotes
with 1.
1. Blue
Indent code block 8 spaces or two tabs:
Prefix
>
for each blockquote line...
List marker must be followed by 1/more spaces or a tab
... or even hard-wrapped paragraph
List marker can be indented upto 3 spaces
*
A list item with a code block:
Additional
>
for nested blockquotes
Hanging indent supported but not required
... some code ....
Blockquotes can contain Markdown
Blank lines between list items implies paragraph
Paragraph start must be indented by 4 spaces or a tab
Automatic Links
To avoid unintended list numbering
(e.g:1986. What a great
Use <, > for auto-linking URLs
season)
backslash the period
(1986\. What a great
season).
Use <, > for auto-linking email addrs
Email text is auto obscured (somewhat)
Images
For all else use HTML markup
![Alt text](URL “Title”)
Markdown
blank lines around block level elements
![Alt text][id]
no indentation for tags
[id]: URL “Title”
no Markdown inside HTML blocks
See syntax for Links
Cheat sheet
from:
Ahren Code

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go