0% found this document useful (0 votes)
108 views10 pages

Markdown Guide Sample PDF

The document discusses the basic syntax of Markdown, including headings, paragraphs, line breaks, emphasis, blockquotes, lists, and nesting. It provides examples of Markdown syntax alongside the equivalent HTML output. Key elements include using # signs for headings, blank lines between paragraphs, ** or __ for bold, * or _ for italics, > for blockquotes, numbers or letters followed by periods for ordered lists, and dashes, asterisks or plus signs for unordered lists. Lists can be nested by indenting items with four spaces.

Uploaded by

Abdul Ghani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views10 pages

Markdown Guide Sample PDF

The document discusses the basic syntax of Markdown, including headings, paragraphs, line breaks, emphasis, blockquotes, lists, and nesting. It provides examples of Markdown syntax alongside the equivalent HTML output. Key elements include using # signs for headings, blank lines between paragraphs, ** or __ for bold, * or _ for italics, > for blockquotes, numbers or letters followed by periods for ordered lists, and dashes, asterisks or plus signs for unordered lists. Lists can be nested by indenting items with four spaces.

Uploaded by

Abdul Ghani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

3.

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

1 I really like using Markdown.


2
3 I think I'll use it from now on.

HTML

1 <p>I really like using Markdown.</p>


2
3 <p>I think I'll use it from now on.</p>

The rendered output looks like this:


I really like using Markdown.
I think I’ll use it from now on.

Line Breaks
To create a line break (<br>), end a line with two or more spaces, and then type
return.
Basic Syntax 15

Markdown

1 This is the first line.


2 And this is the second line.

HTML

1 <p>This is the first line.<br />


2 And this is the second line.</p>

The rendered output looks like this:


This is the first line.
And this is the second line.

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

1 I love **bold text**.


2
3 I love __bold text__.
4
5 Love**is**bold

The HTML output of the first two examples is the same.


Basic Syntax 16

HTML

1 I love <strong>bold text</strong>.


2
3 Love<strong>is</strong>bold

The rendered output looks like this:


I love bold text.
Loveisbold

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 The *cat's meow*.


2
3 The _cat's meow_.
4
5 A*cat*meow

The HTML output of the first two examples is the same.


HTML

1 The <em>cat's meow</em>.


2
3 A<em>cat</em>meow

The rendered output looks like this:


The cat’s meow.
Acatmeow
Basic Syntax 17

Bold and Italic


To emphasize text with bold and italics at the same time, add three asterisks or
underscores before and after a word or phrase.
Markdown

1 ***Important*** text.
2
3 ___Important___ text.
4
5 __*Important*__ text.
6
7 **_Important_** text.

The HTML output of all four examples is the same.


HTML

1 <strong><em>Important</em></strong> text.

The rendered output looks like this:


Important text.

Blockquotes
To create a blockquote, add a > in front of a paragraph.
Markdown

1 > Dorothy followed her through many rooms.


Basic Syntax 18

HTML
1 <blockquote>
2 <p>Dorothy followed her through many rooms.</p>
3 </blockquote>

The rendered output looks like this:

Dorothy followed her through many rooms.

Blockquotes with Multiple Paragraphs


Blockquotes can contain multiple paragraphs. Add a > on the blank lines between
the paragraphs.
Markdown
1 > This the first paragraph.
2 >
3 > And this is the second paragraph.

HTML
1 <blockquote>
2 <p>This the first paragraph.</p>
3 <p>And this is the second paragraph.</p>
4 </blockquote>

The rendered output looks like this:

This the first paragraph.


And this is the second paragraph.

Nested Blockquotes
Blockquotes can be nested. Add a >> in front of the paragraph you want to nest.
Basic Syntax 19

Markdown

1 > This the first paragraph.


2 >
3 >> And this is the nested paragraph.

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>

The rendered output looks like this:

This the first paragraph.

And this is the nested paragraph.

Blockquotes with Other Elements


Blockquotes can contain other Markdown formatted elements. Not all elements can
be used — you’ll need to experiment to see which ones work.
Markdown

1 > ##### The quarterly results look great!


2 >
3 > - Revenue was off the chart.
4 > - Profits were higher than ever.
5 >
6 > *Everything* is going **well**.
Basic Syntax 20

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>

The rendered output looks like this:

The quarterly results look great!

• Revenue was off the chart.


• Profits were higher than ever.

Everything is going well.

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

The HTML output of all three example lists is the same.


HTML
1 <ol>
2 <li>First item</li>
3 <li>Second item</li>
4 <li>Third item</li>
5 <li>Fourth item</li>
6 </ol>

The rendered output looks like this:

1. First item
2. Second item
3. Third item
4. Fourth item

Nesting List Items

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>

The rendered output looks like this:

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.

You might also like