Markdown Guide Sample PDF
Markdown Guide Sample PDF
Basic Syntax
Nearly all Markdown applications support the basic syntax outlined in John Gruber’s
original design document. There are minor variations and discrepancies between
Markdown processors — those are noted inline wherever possible.
Using Markdown doesn’t mean that you can’t also use HTML. You can
add HTML tags to any Markdown file. This is helpful if you prefer certain
HTML tags to Markdown syntax. For example, some people find that it’s
easier to use HTML tags for images.
Headings
To create a heading, add number signs (#) in front of a word or phrase. The number of
number signs you use should correspond to the heading level. For example, to create
a heading level three (<h3>), use three number signs (e.g., ### My Header).
Markdown HTML
# Heading level 1 <h1>Heading level 1</h1>
## Heading level 2 <h2>Heading level 2</h2>
### Heading level 3 <h3>Heading level 3</h3>
#### Heading level 4 <h4>Heading level 4</h4>
##### Heading level 5 <h5>Heading level 5</h5>
###### Heading level 6 <h6>Heading level 6</h6>
Alternate Syntax
Alternatively, on the line below the text, add any number of == characters for heading
level 1 or -- characters for heading level 2.
Basic Syntax 14
Markdown HTML
Heading level 1 <h1>Heading level 1</h1>
===============
Heading level 2 <h2>Heading level 2</h2>
---------------
Paragraphs
To create paragraphs, use a blank line to separate one or more lines of text. You
should not indent paragraphs with spaces or tabs.
Markdown
HTML
Line Breaks
To create a line break (<br>), end a line with two or more spaces, and then type
return.
Basic Syntax 15
Markdown
HTML
Emphasis
You can add emphasis by making text bold or italic.
Bold
To bold text, add two asterisks or underscores before and after a word or phrase. To
bold the middle of a word for emphasis, add two asterisks without spaces around the
letters.
Markdown
HTML
Italic
To italicize text, add one asterisk or underscore before and after a word or phrase. To
italicize the middle of a word for emphasis, add one asterisk without spaces around
the letters.
Markdown
1 ***Important*** text.
2
3 ___Important___ text.
4
5 __*Important*__ text.
6
7 **_Important_** text.
1 <strong><em>Important</em></strong> text.
Blockquotes
To create a blockquote, add a > in front of a paragraph.
Markdown
HTML
1 <blockquote>
2 <p>Dorothy followed her through many rooms.</p>
3 </blockquote>
HTML
1 <blockquote>
2 <p>This the first paragraph.</p>
3 <p>And this is the second paragraph.</p>
4 </blockquote>
Nested Blockquotes
Blockquotes can be nested. Add a >> in front of the paragraph you want to nest.
Basic Syntax 19
Markdown
HTML
1 <blockquote>
2 <p>This the first paragraph.</p>
3 <blockquote>
4 <p>And this is the nested paragraph.</p>
5 </blockquote>
6 </blockquote>
HTML
1 <blockquote>
2 <h5>The quarterly results look great!</h5>
3 <ul>
4 <li>Revenue was off the chart.</li>
5 <li>Profits were higher than ever.</li>
6 </ul>
7 <p><em>Everything</em> is going <strong>well</strong>.</p>
8 </blockquote>
Lists
You can organize items into ordered and unordered lists.
Ordered Lists
To create an ordered list, add line items with numbers followed by periods. The
numbers don’t have to be in numerical order, but the list should start with the number
one.
Basic Syntax 21
Markdown
1 1. First item
2 2. Second item
3 3. Third item
4 4. Fourth item
5
6 1. First item
7 1. Second item
8 1. Third item
9 1. Fourth item
10
11 1. First item
12 8. Second item
13 3. Third item
14 5. Fourth item
1. First item
2. Second item
3. Third item
4. Fourth item
To nest line items in an ordered list, indent the items four spaces or one tab.
Basic Syntax 22
Markdown
1 1. First item
2 2. Second item
3 3. Third item
4 1. Indented item
5 2. Indented item
6 4. Fourth item
HTML
1 <ol>
2 <li>First item</li>
3 <li>Second item</li>
4 <li>Third item
5 <ol>
6 <li>Indented item</li>
7 <li>Indented item</li>
8 </ol>
9 </li>
10 <li>Fourth item</li>
11 </ol>
1. First item
2. Second item
3. Third item
1. Indented item
2. Indented item
4. Fourth item
Unordered Lists
To create an unordered list, add dashes (-), asterisks (*), or plus signs (+) in front of
line items.