Introduction
Definition
Markdown is a lightweight markup language with plain text formatting syntax. Its design allows it to be converted to many output formats, but the original tool by the same name only supports HTML.
Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.
Properties
- Plaint text
- Converts to HTML
- Easy to read and learn
- Enables faster creating and editing of blog posts
Syntax
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, use three number signs (e.g., ### My Header).
1 | # Level 1 |
Emphasis
You can add emphasis by making text bold or italic.
Bold
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.
1 | **bold text** |
The rendered output looks like this: bold text
Italic
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.
1 | *italic text* |
The rendered output looks like this: bold text
Bold and Italic
To emphasize text with bold and italics at the same time, add three asterisks before and after a word or phrase.
1 | ***bold and italic text*** |
The rendered output looks like this: bold and italic text
Blockquotes
To create a blockquote, add a > in front of a paragraph.
1 | > This is a quotation. |
The rendered output looks like this:
This is a quotation.
THis is nested quotation.
Lists
You can organize items into ordered and unordered lists.
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.
1 | - list item1 |
The rendered output looks like this:
- list item1
- list item2
- list
- list
- list
- list item3
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 | 1. list item1 |
The rendered output looks like this:
- list item1
- list item2
- list
- list
- list
- list item3
Horizontal Rules
To create a horizontal rule, use three or more asterisks, dashes, or underscores on a line by themselves.
1 | *** |
Links
To create a link, enclose the link text in brackets and then follow it immediately with the URL in parentheses.
1 | [Google](https://www.google.com/) |
The rendered output looks like this:
Google
Baidu
Code
If the word or phrase you want to denote as code includes one or more tick marks, you can escape it by enclosing the word or phrase in double tick marks.
Images
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 after the URL in the parentheses.
1 | ![Pikachu Detective](https://www.pokemoncenter.com/wcsstore/MarketingContent/detective-pikachu/landing_detective-pikachu_header.jpg "Pikachu Detective") |
The rendered output looks like this:
Form
The second line separates the header and the content.
By default, text is left; Add two colons before and after dashes, text is center; Add one colon after dashes, text is right.
1 | Name|Number|E-mail |
The rendered output looks like this:
Name | Number | |
---|---|---|
Lucas | 1 | xxxxx@xxxx |
Tracy | 2 | xxxxx@xxxx |
Mento | 3 | xxxxx@xxxx |