I. What is Markdown
Targets of Markdown
Markdown is a text-to-HTML conversion tool for web writers by John Gruber @Daringfireball. Thus other details can be seen in author’s website above.
Tools for Markdown
Most people recommend Mou on Mac OS. While on Windows, here are MarkdownPad (much better than the followings …) and MarkPad (er… it’s too slow at least for me). For convenience, I just use Atom by Google with MD plugin, it’s enough for me.
II. Markdown Syntax
Headers
1 | # This is an H1 |
There are 6 levels of header, adding #
, from H1 to H6.
Lists
Markdown supports ordered (numbered) and unordered (bulleted) lists.
unordered
1 | * Red |
is equivalent to:1
2
3- Red
- Green
- Blue
numbered
1 | 1. Bird |
Quotes
Markdown allows you to be lazy and only put the >
before the first line of a hard-wrapped paragraph:
1 | > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, |
shown as,
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
This style is based on the template used in Hexo.
Links and images
Markdown supports two style of links and images: inline and reference.
inline
1 | links : This is [an example](http://example.com/ "Title") inline link. |
If you’re referring to a local resource on the same server, you can use relative paths:
1 | See my [About](/about/) page for details. |
reference
1 | links: This is [an example] [id] reference-style link. |
Code
To indicate a span of code, wrap it with backtick quotes `.1
Use the `printf()` function.
Emphasis
Markdown treats asterisks () and underscores (_) as indicators of emphasis. Text wrapped with one or will be wrapped with an HTML tag; double *’s or ’s will be wrapped with an HTML tag. E.g., this input:
single asterisks
single underscores
double asterisks
double underscores
Tables
An example of table:
1 | | Tables | Are | Cool | |
produce
Tables | Are | Cool |
---|---|---|
col 3 is | right-aligned | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |