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