Record the basic syntax of Markdown
Headings#
To set a text as a heading, add #
before the text.
One #
is a level 1 heading, two #
is a level 2 heading, and so on. A total of six levels of headings are supported.
Example:
# This is a level 1 heading
## This is a level 2 heading
### This is a level 3 heading
#### This is a level 4 heading
##### This is a level 5 heading
###### This is a level 6 heading
Note that there should be a space between the `#` and the content.
Font Styles#
-
Italic
Wrap the text to be italicized with a single*
.
Example:*italic*
Result: italic -
Bold
Wrap the text to be bolded with double*
.
Example:**bold**
Result: bold -
Italic and Bold
Wrap the text to be italicized and bolded with triple*
.
Example:***italic and bold***
Result: italic and bold -
Strikethrough
Wrap the text to be strikethrough with~~
.
Example:~~strikethrough~~
Result:strikethrough
Blockquotes#
Add >
before the quoted text. Blockquotes can also be nested by adding two >
or more.
Example:
> This is a blockquote
>> This is a blockquote
>>> This is a blockquote
Result:
This is a blockquote
This is a blockquote
This is a blockquote
Horizontal Rules#
Three or more -
or *
can be used.
Example:
---
----
***
****
Result:#
The effect is the same for all options. Choose the one you prefer. Personally, I prefer using four -
.
Images#
Syntax:
![alt text](image link)
Example:
![alt text](https://cdn.jsdelivr.net/gh/Rewrite0/FigureBed@master/img/5.png)
Result:
Links#
Similar to images, just remove the !
at the beginning.
Syntax:
[link text](link address)
Example:
[Baidu](https://baidu.com)
Result:
Baidu
Note: Markdown itself does not support opening links in a new window, but Markdown supports HTML syntax. If needed, HTML syntax can be used instead.
Example:
<a href="https://baidu.com" target="_blank">Baidu</a>
Result:
Baidu
Lists#
Unordered Lists#
Use -
, +
, or *
before the content.
Example:
- List
+ List
* List
Note that there should be a space between the symbol and the content.
Result:
- List
- List
- List
As you can see, the effect is the same. Just like horizontal rules, choose the one you prefer.
Ordered Lists#
Add numbers and a dot before the content.
Example:
1. List item
2. List item
3. List item
Note: There should be a space between the number and the content.
Result:
- List item
- List item
- List item
Nested Lists#
Add three spaces before the sub-list.
Example:
- Level 1
- Level 2
- Level 2
- Level 3
- Level 4
In the example, underscores (_) are used instead of spaces for clarity.
Result:
- Level 1
- Level 2
- Level 2
- Level 3
- Level 4
- Level 3
Both ordered and unordered lists can be nested within each other.
Example:
- Unordered
- Ordered
- Ordered
- Unordered
- Ordered
- Unordered
- Unordered
Tables#
Syntax:
| Header | Header | Header |
| ------ | :----: | -----: |
| Content| Content| Content|
| Content| Content| Content|
The second row separates the header and the content.
- One is enough, but adding more makes it easier to align.
Text is left-aligned by default.
- Add a colon (:) on both sides to center the text.
- Add a colon (:) on the right side to right-align the text.
Note: The | on both sides of the table can be omitted.
That is:
Header | Header | Header
------ | :----: | -----:
Content| Content| Content
Content| Content| Content
Example:
Left-aligned | Right-aligned | Center-aligned
:-----|-----:|:------:
Content| Content | Content
Content| Content | Content
Result:
Left-aligned | Right-aligned | Center-aligned |
---|---|---|
Content | Content | Content |
Content | Content | Content |
Code#
Syntax:
Inline code: Wrap the code with backticks.
`code`
Code block: Wrap the code with three backticks, and the backticks should be on a separate line.
(```)
code...
code...
(```)
Here, parentheses are used to prevent it from being recognized as a code block. They are not needed when using it.