Markdown quick reference

Document Sample
Markdown quick reference Powered By Docstoc
					                                                            * One
Markdown quick reference                                    * Two
                                                            * Three
‘&’ and ‘<’ are automatically escaped. So :
                                                            - One
                                                            - Two
                                                            - Three

will be left as is, but :

S&P 500
                                                            + One
                                                            + Two
will be translated to :                                     + Three

S&amp;P 500
                                                            Ordered lists are created by putting a number followed
Similarly, inline HTML will not escaped, while the follo-   by a dot at the beginning of each line :
wing will :
                                                            1. One
1 < 2.                                                      2. Two

Generally speaking, Markdown is not meant to be a           Note that the actual numbers that you use do not mat-
layer above HTML. So HTML is needed, use inline HTML.       ter, so the example above would produce the exact
                                                            same HTML code than the following :
                                                            29. One
The easiest possibility for header tags is as follows :     2. Two

# My title                                                  Which is :
## My subtitle
### My sub-subtitle                                         <ol>
###### You get the idea                                             <li>One</li>
Another, more readable possibility for <h1> and <h2>        </ol>
tags :
                                                            The numbers actually don’t even need to be different
My title                                                    from each other.
                                                            If you want each item to be wrapped in a <p> tag, just
                                                            add a blank line between each line :
My subtitle
                                                            * One

                                                            * Two
                                                            This will produce :
You like in text emails, quoting is achieved using “grea-
ter-than” signs :
> This is a quote                                                   <li><p>Two</p></li>
Quotes can be nested, as in :
                                                            Each item can contain multiple paragraphs.
> A quote
> > A subquote                                              Ordered lists can inadvertently be triggered, if for some
> Back to the first level                                   reason a line begins with a number followed by a dot. In
                                                            such a case, one has to escape the dot using a
Quotes can contain most other Markdown elements,            backslash, as in :
including headers, lists and code blocks (see below).
                                                            1\. This is not a list.
                                                            Lists can contain a variety of other elements, including
Unordered lists are created by putting a plus, a minus      quotes and code blocks.
or a star at the beginning of each line :
Code blocks                                                    <>

Code blocks are triggered by identing text by four (or         The same goes for email addresses.
more spaces), or one tab.

Not code
      Code                                                     Images

Means :                                                        The syntax for images is similar to links :

<p>Not code</p>                                                ![Alt text](
                                                               References are also admitted :
In a code block, “&”, “<” and “>” characters are auto-
matically escaped. Also note that Markdown syntax is           ![Alt text][img]
not processed in a code block.                                 Blah blah blah

Alternatively, a span of code is marked by surrounding
some text with backticks, as in :

The main function of a C program is defined by
`int main(int argc, char **argv)`
                                                               <em> and <strong> tags

                                                               Emphasis is marked by surrounding text with “*”, “_”,
Link                                                           “**” or “__” :

Here is the basic syntax for links :                           *emphasis*
Check out [thingylab](                 **more emphasis**
“Thingylab”) !                                                 __more emphasis__

The text between angle brackets a the clickable link,          yields :
then come between parenthesis the address and the
title attribute. Note that the latter is optionnal. Relative   <em>emphasis</em>
addresses are allowed too.                                     <em>emphasis</em>
                                                               <strong>more emphasis</strong>
One can also use another, more readable syntax :               <strong>more emphasis</strong>

Check out [thingylab][link], you will find a                   Those can also be escaped using a backslash.
Markdown reference there.
                                                               Horizontal rules
[link]: “Thingylab”
                                                               If you really need those, it’s easy, place three or more
You can place the second part anywhere in the docu-            “*” or “-” on a line (without anything else).
ment, but the best place is probably just after each
paragraph.                                                     Escaping

The link text can also be implicitly used as the reference     The following tags can be escape using a backslash :
:                                                              \`*_{}[]()#+-.!

Check out [thingylab][], you will find a Markdown              Credits
referende there.
                                                               This reference was compiled by Pierre DOUCY
                                                               (pierre<at> Don’t hesitate to send me
                                                               your remarks.

Note that references are not case-sensitive, so the two
following lines refer to the same address :


If you want to use an URL as the text for a link, you can
just use the following syntax :