Show Menu
Cheatography

Markdown Syntax Cheat Sheet Cheat Sheet (DRAFT) by

Markdown syntax cheat sheet.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

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
).

# Heading level 1


## Heading level 2


### Heading level 3


#### Heading level 4


##### Heading level 5


###### Heading level 6


Altern­ati­vely, on the line below the text, add any number of
==
characters for heading level 1 or
--
characters for heading level 2.

Heading level 1

======­===­======


Heading level 2

------­---­------
Markdown applic­ations don’t agree on how to handle a missing space between the number signs (
#
) and the heading name. For compat­ibi­lity, always put a space between the number signs and the heading name.

You should also put blank lines before and after a heading for compat­ibility

Paragraphs

To create paragr­aphs, use a blank line to separate one or more lines of text.
Unless the paragraph is in a list, don’t indent paragraphs with spaces or tabs.

Line Breaks

To create a line break or new line (
<br>
), end a line with two or more spaces, and then type return.

You can use two or more spaces (commonly referred to as “trailing white space”) for line breaks in nearly every Markdown applic­ation, but it’s contro­ver­sial. It’s hard to see trailing white space in an editor, and many people accide­ntally or intent­ionally put two spaces after every sentence. For this reason, you may want to use something other than trailing white space for line breaks. If your Markdown applic­ation supports HTML, you can use the
<br>
HTML tag.
For compat­ibi­lity, use trailing white space or the
<br>
HTML tag at the end of the line.

CommonMark and a few other lightw­eight markup languages let you type a backslash (`\`) at the end of the line, but not all Markdown applic­ations support this, so it isn’t a great option from a compat­ibility perspe­ctive.

And at least a couple lightw­eight markup languages don’t require anything at the end of the line - just type return and they’ll create a line break.

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.

1. First item

2. Second item

3. Third item

    1. Indented item

    2. Indented item

4. Fourth item
CommonMark and a few other lightw­eight markup languages let you use a parent­hesis (
)
) as a delimiter (e.g.,
1) First item
), but not all Markdown applic­ations support this, so it isn’t a great option from a compat­ibility perspe­ctive. For compat­ibi­lity, use periods only.

Unordered Lists

To create an unordered list, add dashes (
-
), asterisks (
*
), or plus signs (
+
) in front of line items. Indent one or more items to create a nested list.

- First item

- Second item

- Third item

    - Indented item

    - Indented item

- Fourth item


+ First item

+ Second item

+ Third item

    + Indented item

    + Indented item

+ Fourth item


* First item

* Second item

* Third item

    * Indented item

    * Indented item

* Fourth item


Starting Unordered List Items With Numbers

If you need to start an unordered list item with a number followed by a period, you can use a backslash (`\`) to escape the period.

- 1968\. A great year!

- I think 1969 was second best.
Markdown applic­ations don’t agree on how to handle different delimiters in the same list. For compat­ibi­lity, don’t mix and match delimiters in the same list — pick one and stick with it.

Adding Elements in Lists

To add another element in a list while preserving the continuity of the list, indent the element four spaces or one tab, as shown in the following examples.

Paragraphs

* This is the first list item.

* Here's the second list item.

`
    I need to add another paragraph below the second list item.


* And here's the third list item.


Blockq­uotes

* This is the first list item.

* Here's the second list item.


    > A blockquote would look great below the second list item.


* And here's the third list item.


Code blocks

Code blocks are normally indented four spaces or one tab. When they’re in a list, indent them eight spaces or two tabs.

1. Open the file.

2. Find the following code block on line 21:


        <ht­ml>

          <he­ad>

            <ti­tle­>Te­st<­/ti­tle>

          </h­ead>


3. Update the title to match the name of your website.


Images

1. Open the file containing the Linux mascot.

2. Marvel at its beauty.


    !Tux, the Linux mascot


3. Close the file.


Lists

You can nest an unordered list in an ordered list, or vice versa.

1. First item

2. Second item

3. Third item

    - Indented item

    - Indented item

4. Fourth item
 

Bold

To bold text, add two asterisks or unders­cores before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters.

I just love **bold text**.

I just love __bold text__.

Love**­is**­bold
Markdown applic­ations don’t agree on how to handle unders­cores in the middle of a word. For compat­ibi­lity, use asterisks to bold the middle of a word for emphasis.

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.

Italicized text is the *cat's meow*.

Italicized text is the _cat's meow_.

A*\cat­*meow.
Markdown applic­ations don’t agree on how to handle unders­cores in the middle of a word. For compat­ibi­lity, use asterisks to italicize the middle of a word for emphasis.

Bold and Italic

To emphasize text with bold and italics at the same time, add three asterisks or unders­cores before and after a word or phrase. To bold and italicize the middle of a word for emphasis, add three asterisks without spaces around the letters.

This text is ***really import­ant***.

This text is ___really import­ant___.

This text is __*really import­ant*__.

This text is **_really import­ant_**.

This is really­***­ver­y***­im­portant text.
The order of the em and strong tags might be reversed depending on the Markdown processor you're using.

Markdown applic­ations don’t agree on how to handle unders­cores in the middle of a word. For compat­ibi­lity, use asterisks to bold and italicize the middle of a word for emphasis.

Blockquote

To create a blockq­uote, add a
>
in front of a paragraph.

> This is a blockq­uote.


Blockq­uotes with Multiple Paragraphs

Blockq­uotes can contain multiple paragr­aphs. Add a
>
on the blank lines between the paragr­aphs.

> This is a blockq­uote.

>

> Contin­uation of the blockq­uote.


Nested Blockq­uotes

Blockq­uotes can be nested. Add a
>>
in front of the paragraph you want to nest.

> This is a blockq­uote.

>

>> This is a nested blockquote


Blockq­uotes with Other Elements

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

> #### Blockquote with heading!

>

> - List item inside blockq­uote.

> - List item inside blockq­uote.

>

>  *Italic* and **bold** are also available.
For compat­ibi­lity, put blank lines before and after blockq­uotes.

Horizontal Rules

To create a horizontal rule, use three or more asterisks (
***
), dashes (
---
), or unders­cores (
___
) on a line by themse­lves.

***


---


______­___­___­_____
For compat­ibi­lity, put blank lines before and after horizontal rules.