Basic Markdown Syntax - flarom/cohesion GitHub Wiki
Quoted from the Markdown Guide.
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 | Rendered Output |
---|---|---|
# 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> |
Alternatively, on the line below the text, add any number of ==
characters for heading level 1 or --
characters for heading level 2.
Markdown | HTML | Rendered Output |
---|---|---|
Heading level 1 ===============
|
<h1>Heading level 1</h1> |
|
Heading level 2 ===============
|
<h2>Heading level 2</h2> |
To create paragraphs, use a blank line to separate one or more lines of text.
Markdown | HTML | Rendered Output |
---|---|---|
I really like using Markdown. I think I'll use it to format all of my documents from now on.
|
<p>I really like using Markdown.</p> <p>I think I'll use it to format all of my documents from now on.</p>
|
I really like using Markdown. I think I'll use it to format all of my documents from now on. |
To create a line break or new line (<br>
), end a line with two or more spaces, and then type return.
Markdown | HTML | Rendered Output |
---|---|---|
This is the first line. And this is the second line.
|
<p>This is the first line.<br>And this is the second line.</p> |
This is the first line. |
You can add emphasis by making text bold or italic.
To bold text, add two asterisks 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 | Rendered Output |
---|---|---|
I just love **bold text**. |
I just love <strong>bold text</strong>. |
I just love bold text. |
Love**is**bold |
Love<strong>is</strong>bold |
Loveisbold |
To italicize text, add one asterisk 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 | HTML | Rendered Output |
---|---|---|
Italicized text is the cat's meow. | Italicized text is the <em>cat's meow</em>. |
Italicized text is the cat's meow. |
A*cat*meow |
A<em>cat</em>meow |
Acatmeow |
To create a blockquote, add a >
in front of a paragraph.
> Dorothy followed her through many of the beautiful rooms in her castle.
The rendered output looks like this:
Dorothy followed her through many of the beautiful rooms in her castle.
Blockquotes can contain multiple paragraphs. Add a >
on the blank lines between the paragraphs.
> Dorothy followed her through many of the beautiful rooms in her castle.
>
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
The rendered output looks like this:
Dorothy followed her through many of the beautiful rooms in her castle.
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
Blockquotes can be nested. Add a >>
in front of the paragraph you want to nest.
> Dorothy followed her through many of the beautiful rooms in her castle.
>
>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
The rendered output looks like this:
Dorothy followed her through many of the beautiful rooms in her castle.
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
Blockquotes can contain other Markdown formatted elements. Not all elements can be used — you’ll need to experiment to see which ones work.
> #### The quarterly results look great!
>
> - Revenue was off the chart.
> - Profits were higher than ever.
>
> *Everything* is going according to **plan**.
The rendered output looks like this:
- Revenue was off the chart.
- Profits were higher than ever.
Everything is going according to plan.
Admonitions are frequently used in documentation to call attention to warnings, notes, and tips. To create a admonition add the block title between [!
and ]
.
> [!WARNING]
> Do not push the big red button.
> [!NOTE]
> Sunrises are beautiful.
> [!TIP]
> Remember to appreciate the little things in life.
The rendered output looks like this:
Warning
Do not push the big red button.
Note
Sunrises are beautiful.
Tip
Remember to appreciate the little things in life.
You can organize items into ordered and unordered 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.
Markdown | HTML | Rendered Output |
---|---|---|
1. First item
|
<ol>
|
|
1. First item
|
<ol>
|
|
1. First item
|
<ol>
|
|
1. First item
|
<ol>
|
|
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.
Markdown | HTML | Rendered Output |
---|---|---|
- First item
|
<ul>
|
|
* First item
|
<ul>
|
|
+ First item
|
<ul>
|
|
- First item
|
<ul>
|
|
To denote a word or phrase as code, enclose it in backticks (`
).
Markdown | HTML | Rendered Output |
---|---|---|
At the command prompt, type `nano`. |
At the command prompt, type <code>nano</code>. |
At the command prompt, type nano . |
To create code blocks, indent every line of the block by at least four spaces or one tab.
<html>
<head>
</head>
</html>
The rendered output looks like this:
<html>
<head>
</head>
</html>
Note
To create code blocks without indenting lines, use fenced code blocks.
To create a horizontal rule, use three or more asterisks (***
), dashes (---
), or underscores (___
) on a line by themselves.
***
---
_________________
The rendered output of all three looks identical:
To create a link, enclose the link text in brackets (e.g., [Ecosia]
) and then follow it immediately with the URL in parentheses (e.g., (https://www.ecosia.org/)
).
My favorite search engine is [Ecosia](https://www.ecosia.org/).
The rendered output looks like this:
My favorite search engine is Ecosia.
Note
To link to an element on the same page, see linking to heading IDs. To create a link that opens in a new tab or window, see the section on link targets.
You can optionally add a title for a link. This will appear as a tooltip when the user hovers over the link. To add a title, enclose it in quotation marks after the URL.
My favorite search engine is [Ecosia](https://www.ecosia.org/ "Familiar search, greener impact").
The rendered output looks like this:
My favorite search engine is Ecosia.
To quickly turn a URL or email address into a link, enclose it in angle brackets.
<https://example.com>
<[email protected]>
The rendered output looks like this:
https://example.com
[email protected]
To add an image, add an exclamation mark (!
), followed by alt text in brackets, and the path or URL to the image asset in parentheses. You can optionally add a title in quotation marks after the path or URL.

The rendered output looks like this:
You can use HTML tags over your Markdown document. This is helpful if you prefer certain HTML tags to Markdown syntax. For example, some people find it easier to use HTML tags for images. Using HTML is also helpful when you need to change the attributes of an element, like specifying the color of text or changing the width of an image.
To use HTML, place the tags in the text of your Markdown-formatted file.
This **word** is bold. This <em>word</em> is italic.
The rendered output looks like this:
This word is bold. This word is italic.
Note that markdown elements are disabled inside of block-level HTML tags. For example <div>**This will not render bold**</div>
. This is intended behaviour.
To remediate this effect, you can set markdown="1"
as a propertie in your block.
<div markdown="1">
**This is Markdown's bold text**
</div>
The rendered output looks like this:
This is Markdown's bold text