<divclass="col-main cell cell--auto"><!-- start custom main top snippet --><divid="results-container"class="search-result js-search-result"></div><!-- end custom main top snippet -->
<p><strong>Note:</strong> This document is itself written using Markdown; you
can <ahref="/projects/markdown/syntax.text">see the source for it by adding ‘.text’ to the URL</a>.</p>
<hr/>
<h2id="overview">Overview</h2>
<h3id="philosophy">Philosophy</h3>
<p>Markdown is intended to be as easy-to-read and easy-to-write as is feasible.</p>
<p>Readability, however, is emphasized above all else. A Markdown-formatted
document should be publishable as-is, as plain text, without looking
like it’s been marked up with tags or formatting instructions. While
Markdown’s syntax has been influenced by several existing text-to-HTML
filters – including <ahref="http://docutils.sourceforge.net/mirror/setext.html">Setext</a>, <ahref="http://www.aaronsw.com/2002/atx/">atx</a>, <ahref="http://textism.com/tools/textile/">Textile</a>, <ahref="http://docutils.sourceforge.net/rst.html">reStructuredText</a>,
<ahref="http://www.triptico.com/software/grutatxt.html">Grutatext</a>, and <ahref="http://ettext.taint.org/doc/">EtText</a>– the single biggest source of
inspiration for Markdown’s syntax is the format of plain text email.</p>
<p>To this end, Markdown’s syntax is comprised entirely of punctuation
characters, which punctuation characters have been carefully chosen so
as to look like what they mean. E.g., asterisks around a word actually
look like *emphasis*. Markdown lists look like, well, lists. Even
blockquotes look like quoted passages of text, assuming you’ve ever
used email.</p>
<h3id="html">Inline HTML</h3>
<p>Markdown’s syntax is intended for one purpose: to be used as a
format for <em>writing</em> for the web.</p>
<p>Markdown is not a replacement for HTML, or even close to it. Its
syntax is very small, corresponding only to a very small subset of
HTML tags. The idea is <em>not</em> to create a syntax that makes it easier
to insert HTML tags. In my opinion, HTML tags are already easy to
insert. The idea for Markdown is to make it easy to read, write, and
edit prose. HTML is a <em>publishing</em> format; Markdown is a <em>writing</em>
format. Thus, Markdown’s formatting syntax only addresses issues that
can be conveyed in plain text.</p>
<p>For any markup that is not covered by Markdown’s syntax, you simply
use HTML itself. There’s no need to preface it or delimit it to
indicate that you’re switching from Markdown to HTML; you just use
the tags.</p>
<p>The only restrictions are that block-level HTML elements – e.g. <codeclass="language-plaintext highlighter-rouge"><div></code>,
<codeclass="language-plaintext highlighter-rouge"><table></code>, <codeclass="language-plaintext highlighter-rouge"><pre></code>, <codeclass="language-plaintext highlighter-rouge"><p></code>, etc. – must be separated from surrounding
content by blank lines, and the start and end tags of the block should
not be indented with tabs or spaces. Markdown is smart enough not
to add extra (unwanted) <codeclass="language-plaintext highlighter-rouge"><p></code> tags around HTML block-level tags.</p>
<p>For example, to add an HTML table to a Markdown article:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>This is a regular paragraph.
<table>
<tr>
<td>Foo</td>
</tr>
</table>
This is another regular paragraph.
</code></pre></div></div>
<p>Note that Markdown formatting syntax is not processed within block-level
HTML tags. E.g., you can’t use Markdown-style <codeclass="language-plaintext highlighter-rouge">*emphasis*</code> inside an
HTML block.</p>
<p>Span-level HTML tags – e.g. <codeclass="language-plaintext highlighter-rouge"><span></code>, <codeclass="language-plaintext highlighter-rouge"><cite></code>, or <codeclass="language-plaintext highlighter-rouge"><del></code>– can be
used anywhere in a Markdown paragraph, list item, or header. If you
want, you can even use HTML tags instead of Markdown formatting; e.g. if
you’d prefer to use HTML <codeclass="language-plaintext highlighter-rouge"><a></code> or <codeclass="language-plaintext highlighter-rouge"><img></code> tags instead of Markdown’s
link or image syntax, go right ahead.</p>
<p>Unlike block-level HTML tags, Markdown syntax <em>is</em> processed within
span-level tags.</p>
<h3id="autoescape">Automatic Escaping for Special Characters</h3>
<p>In HTML, there are two characters that demand special treatment: <codeclass="language-plaintext highlighter-rouge"><</code>
and <codeclass="language-plaintext highlighter-rouge">&</code>. Left angle brackets are used to start tags; ampersands are
used to denote HTML entities. If you want to use them as literal
characters, you must escape them as entities, e.g. <codeclass="language-plaintext highlighter-rouge">&lt;</code>, and
<p>However, inside Markdown code spans and blocks, angle brackets and
ampersands are <em>always</em> encoded automatically. This makes it easy to use
Markdown to write about HTML code. (As opposed to raw HTML, which is a
terrible format for writing about HTML syntax, because every single <codeclass="language-plaintext highlighter-rouge"><</code>
and <codeclass="language-plaintext highlighter-rouge">&</code> in your example code needs to be escaped.)</p>
<hr/>
<h2id="block">Block Elements</h2>
<h3id="p">Paragraphs and Line Breaks</h3>
<p>A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like a
blank line – a line containing nothing but spaces or tabs is considered
blank.) Normal paragraphs should not be indented with spaces or tabs.</p>
<p>The implication of the “one or more consecutive lines of text” rule is
that Markdown supports “hard-wrapped” text paragraphs. This differs
significantly from most other text-to-HTML formatters (including Movable
Type’s “Convert Line Breaks” option) which translate every line break
character in a paragraph into a <codeclass="language-plaintext highlighter-rouge"><br /></code> tag.</p>
<p>When you <em>do</em> want to insert a <codeclass="language-plaintext highlighter-rouge"><br /></code> break tag using Markdown, you
end a line with two or more spaces, then type return.</p>
<p>Yes, this takes a tad more effort to create a <codeclass="language-plaintext highlighter-rouge"><br /></code>, but a simplistic
“every line break is a <codeclass="language-plaintext highlighter-rouge"><br /></code>” rule wouldn’t work for Markdown.
Markdown’s email-style <ahref="#blockquote">blockquoting</a> and multi-paragraph <ahref="#list">list items</a>
work best – and look better – when you format them with hard breaks.</p>
<h3id="header">Headers</h3>
<p>Markdown supports two styles of headers, <ahref="http://docutils.sourceforge.net/mirror/setext.html">Setext</a> and <ahref="http://www.aaronsw.com/2002/atx/">atx</a>.</p>
<p>Setext-style headers are “underlined” using equal signs (for first-level
headers) and dashes (for second-level headers). For example:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>This is an H1
=============
This is an H2
-------------
</code></pre></div></div>
<p>Any number of underlining <codeclass="language-plaintext highlighter-rouge">=</code>’s or <codeclass="language-plaintext highlighter-rouge">-</code>’s will work.</p>
<p>Atx-style headers use 1-6 hash characters at the start of the line,
corresponding to header levels 1-6. For example:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code># This is an H1
## This is an H2
###### This is an H6
</code></pre></div></div>
<p>Optionally, you may “close” atx-style headers. This is purely
cosmetic – you can use this if you think it looks better. The
closing hashes don’t even need to match the number of hashes
used to open the header. (The number of opening hashes
determines the header level.) :</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code># This is an H1 #
## This is an H2 ##
### This is an H3 ######
</code></pre></div></div>
<h3id="blockquote">Blockquotes</h3>
<p>Markdown uses email-style <codeclass="language-plaintext highlighter-rouge">></code> characters for blockquoting. If you’re
familiar with quoting passages of text in an email message, then you
know how to create a blockquote in Markdown. It looks best if you hard
wrap the text and put a <codeclass="language-plaintext highlighter-rouge">></code> before every line:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>> 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.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
</code></pre></div></div>
<p>Markdown allows you to be lazy and only put the <codeclass="language-plaintext highlighter-rouge">></code> before the first
line of a hard-wrapped paragraph:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>> 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.
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.
</code></pre></div></div>
<p>Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
adding additional levels of <codeclass="language-plaintext highlighter-rouge">></code>:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>> This is the first level of quoting.
>
>> This is nested blockquote.
>
> Back to the first level.
</code></pre></div></div>
<p>Blockquotes can contain other Markdown elements, including headers, lists,
and code blocks:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>> ## This is a header.
<p>you’d get the exact same HTML output. The point is, if you want to,
you can use ordinal numbers in your ordered Markdown lists, so that
the numbers in your source match the numbers in your published HTML.
But if you want to be lazy, you don’t have to.</p>
<p>If you do use lazy list numbering, however, you should still start the
list with the number 1. At some point in the future, Markdown may support
starting ordered lists at an arbitrary number.</p>
<p>List markers typically start at the left margin, but may be indented by
up to three spaces. List markers must be followed by one or more spaces
or a tab.</p>
<p>To make lists look nice, you can wrap items with hanging indents:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
</code></pre></div></div>
<p>But if you want to be lazy, you don’t have to:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
</code></pre></div></div>
<p>If list items are separated by blank lines, Markdown will wrap the
items in <codeclass="language-plaintext highlighter-rouge"><p></code> tags in the HTML output. For example, this input:</p>
<p>List items may consist of multiple paragraphs. Each subsequent
paragraph in a list item must be indented by either 4 spaces
or one tab:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>1. This is a list item 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. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.
</code></pre></div></div>
<p>It looks nice if you indent every line of the subsequent
paragraphs, but here again, Markdown will allow you to be
lazy:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>* This is a list item with two paragraphs.
This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.
* Another item in the same list.
</code></pre></div></div>
<p>To put a blockquote within a list item, the blockquote’s <codeclass="language-plaintext highlighter-rouge">></code>
delimiters need to be indented:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>* A list item with a blockquote:
> This is a blockquote
> inside a list item.
</code></pre></div></div>
<p>To put a code block within a list item, the code block needs
to be indented <em>twice</em>– 8 spaces or two tabs:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>* A list item with a code block:
<code goes here>
</code></pre></div></div>
<p>It’s worth noting that it’s possible to trigger an ordered list by
accident, by writing something like this:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>1986. What a great season.
</code></pre></div></div>
<p>In other words, a <em>number-period-space</em> sequence at the beginning of a
line. To avoid this, you can backslash-escape the period:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>1986\. What a great season.
</code></pre></div></div>
<h3id="precode">Code Blocks</h3>
<p>Pre-formatted code blocks are used for writing about programming or
markup source code. Rather than forming normal paragraphs, the lines
of a code block are interpreted literally. Markdown wraps a code block
in both <codeclass="language-plaintext highlighter-rouge"><pre></code> and <codeclass="language-plaintext highlighter-rouge"><code></code> tags.</p>
<p>To produce a code block in Markdown, simply indent every line of the
block by at least 4 spaces or 1 tab. For example, given this input:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>This is a normal paragraph:
This is a code block.
</code></pre></div></div>
<p>Markdown will generate:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p>This is a normal paragraph:</p>
<pre><code>This is a code block.
</code></pre>
</code></pre></div></div>
<p>One level of indentation – 4 spaces or 1 tab – is removed from each
line of the code block. For example, this:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>Here is an example of AppleScript:
tell application "Foo"
beep
end tell
</code></pre></div></div>
<p>will turn into:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p>Here is an example of AppleScript:</p>
<pre><code>tell application "Foo"
beep
end tell
</code></pre>
</code></pre></div></div>
<p>A code block continues until it reaches a line that is not indented
(or the end of the article).</p>
<p>Within a code block, ampersands (<codeclass="language-plaintext highlighter-rouge">&</code>) and angle brackets (<codeclass="language-plaintext highlighter-rouge"><</code> and <codeclass="language-plaintext highlighter-rouge">></code>)
are automatically converted into HTML entities. This makes it very
easy to include example HTML source code using Markdown – just paste
it and indent it, and Markdown will handle the hassle of encoding the
ampersands and angle brackets. For example, this:</p>
<p>Link definitions can be placed anywhere in your Markdown document. I
tend to put them immediately after each paragraph in which they’re
used, but if you want, you can put them all at the end of your
document, sort of like footnotes.</p>
<p>Here’s an example of reference links in action:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>I get 10 times more traffic from [Google] [1] than from
[Yahoo] [2] or [MSN] [3].
[1]: http://google.com/ "Google"
[2]: http://search.yahoo.com/ "Yahoo Search"
[3]: http://search.msn.com/ "MSN Search"
</code></pre></div></div>
<p>Using the implicit link name shortcut, you could instead write:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>I get 10 times more traffic from [Google][] than from
[Yahoo][] or [MSN][].
[google]: http://google.com/ "Google"
[yahoo]: http://search.yahoo.com/ "Yahoo Search"
[msn]: http://search.msn.com/ "MSN Search"
</code></pre></div></div>
<p>Both of the above examples will produce the following HTML output:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p>I get 10 times more traffic from <a href="http://google.com/"
or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
</code></pre></div></div>
<p>For comparison, here is the same paragraph written using
Markdown’s inline link style:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>I get 10 times more traffic from [Google](http://google.com/ "Google")
than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
[MSN](http://search.msn.com/ "MSN Search").
</code></pre></div></div>
<p>The point of reference-style links is not that they’re easier to
write. The point is that with reference-style links, your document
source is vastly more readable. Compare the above examples: using
reference-style links, the paragraph itself is only 81 characters
long; with inline-style links, it’s 176 characters; and as raw HTML,
it’s 234 characters. In the raw HTML, there’s more markup than there
is text.</p>
<p>With Markdown’s reference-style links, a source document much more
closely resembles the final output, as rendered in a browser. By
allowing you to move the markup-related metadata out of the paragraph,
you can add links without interrupting the narrative flow of your
prose.</p>
<h3id="em">Emphasis</h3>
<p>Markdown treats asterisks (<codeclass="language-plaintext highlighter-rouge">*</code>) and underscores (<codeclass="language-plaintext highlighter-rouge">_</code>) as indicators of
emphasis. Text wrapped with one <codeclass="language-plaintext highlighter-rouge">*</code> or <codeclass="language-plaintext highlighter-rouge">_</code> will be wrapped with an
HTML <codeclass="language-plaintext highlighter-rouge"><em></code> tag; double <codeclass="language-plaintext highlighter-rouge">*</code>’s or <codeclass="language-plaintext highlighter-rouge">_</code>’s will be wrapped with an HTML
<codeclass="language-plaintext highlighter-rouge"><strong></code> tag. E.g., this input:</p>
<p>But if you surround an <codeclass="language-plaintext highlighter-rouge">*</code> or <codeclass="language-plaintext highlighter-rouge">_</code> with spaces, it’ll be treated as a
literal asterisk or underscore.</p>
<p>To produce a literal asterisk or underscore at a position where it
would otherwise be used as an emphasis delimiter, you can backslash
escape it:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>\*this text is surrounded by literal asterisks\*
</code></pre></div></div>
<h3id="code">Code</h3>
<p>To indicate a span of code, wrap it with backtick quotes (<codeclass="language-plaintext highlighter-rouge">`</code>).
Unlike a pre-formatted code block, a code span indicates code within a
normal paragraph. For example:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>Use the `printf()` function.
</code></pre></div></div>
<p>will produce:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p>Use the <code>printf()</code> function.</p>
</code></pre></div></div>
<p>To include a literal backtick character within a code span, you can use
multiple backticks as the opening and closing delimiters:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>``There is a literal backtick (`) here.``
</code></pre></div></div>
<p>which will produce this:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p><code>There is a literal backtick (`) here.</code></p>
</code></pre></div></div>
<p>The backtick delimiters surrounding a code span may include spaces –
one after the opening, one before the closing. This allows you to place
literal backtick characters at the beginning or end of a code span:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>A single backtick in a code span: `` ` ``
A backtick-delimited string in a code span: `` `foo` ``
</code></pre></div></div>
<p>will produce:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p>A single backtick in a code span: <code>`</code></p>
<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
</code></pre></div></div>
<p>With a code span, ampersands and angle brackets are encoded as HTML
entities automatically, which makes it easy to include example HTML
tags. Markdown will turn this:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>Please don't use any `<blink>` tags.
</code></pre></div></div>
<p>into:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
</code></pre></div></div>
<p>You can write this:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>`&#8212;` is the decimal-encoded equivalent of `&mdash;`.
</code></pre></div></div>
<p>to produce:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><p><code>&amp;#8212;</code> is the decimal-encoded
equivalent of <code>&amp;mdash;</code>.</p>
</code></pre></div></div>
<h3id="img">Images</h3>
<p>Admittedly, it’s fairly difficult to devise a “natural” syntax for
placing images into a plain text document format.</p>
<p>Markdown uses an image syntax that is intended to resemble the syntax
for links, allowing for two styles: <em>inline</em> and <em>reference</em>.</p>
<p>Where “id” is the name of a defined image reference. Image references
are defined using syntax identical to link references:</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>[id]: url/to/image "Optional title attribute"
</code></pre></div></div>
<p>As of this writing, Markdown has no syntax for specifying the
dimensions of an image; if this is important to you, you can simply
use regular HTML <codeclass="language-plaintext highlighter-rouge"><img></code> tags.</p>
<hr/>
<h2id="misc">Miscellaneous</h2>
<h3id="autolink">Automatic Links</h3>
<p>Markdown supports a shortcut style for creating “automatic” links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:</p>