Markdown-Tutorial
Markdown Tutorial
💡 Before we use Markdown,we should learn some basic and the most commonly used grammar
1. Headers
Use
#
to show headers, the first level header uses one#
, the second level header uses two##
, and so on. There are six levels of headers. There also should have a space between#
and headerfirst header
second header
third header
fourth header
fifth header
sixth header
1
2
3
4
5
6
7
8
9
10
11# first header
## second header
### third header
#### fourth header
##### fifth header
###### sixth header
2. Quotes
Use >
to show quotes, >>
is used to show the second level quote in the first quote
- if you use both
>
and>>
, when you want to use the first level out of the second level, you should input a new empty line, if not, it will also be the second quote - You can use many other symbol in quote, like emphasis
❗ Some editors do not support multiple levels of quotes, it is recommended not to use
demo:
first quote
second quote
third quote
first quote
1 | > first quote |
3. Code blocks
Use ```
to show code blocks. You can declare code language to make code blocks highlighting
demo:
1 | $(document).ready(function() { |
1 | ```javascript |
4. Inline codes
Use `` to show inline codes
demo:
this is javascript
code
1 | this is `javascript` code |
5. Links
Use [](link)
to show links
- The words in
[]
are what you want to show -
link
is the url where you want to link
demo:
I think xu.ci is a really good blog 😘.
1 | I think [xu.ci](https://xu.ci) is a really good blog 😘. |
6. Math formulas
❗ The grammar of formula supported by some editors is not the same, here is Typora as an example
Use $$
to show math formulas
demo:
$$
\sum_{n=1}^{100}{a_n}
$$
1 | $$ |
7. Images
Use ![Alt text](/path/to/img.jpg)
to show images
-
Alt text
is the text displayed if the image cannot be displayed -
/path/to/img.jpg
is the image’s url
demo:
1 | ![Markdown](https://i.loli.net/2020/03/14/I8wCZN4r9UltqTd.jpg) |
8. Todo Lists
Use - [ ]
and - [x]
to show todo lists.
- Todo List
- Todo list
1 | - [x] Todo List |
9. Bold,italic,highlight和delete line
- Use
**
or__
to show bold
1 | **bold** |
- Use
*
or_
to show italic
1 | *italic* |
- Use
***
to show both bold and italic
1 | ***both bold and italic*** |
- Use
==
to show ==highlight==
❗ Some editors do not support highlighting
1 | ==highlight== |
- Use
~~
to showdelete line
1 | ~~delete line~~ |
- There is no space between
*
,=
or_
10. Lists
Use 1.
to show ordered lists, use *
or -
or +
to show unordered lists. There should be a space behind it
demo 1: ordered lists
- first
- second
- third
1 | 1. first |
demo 2: unordered lists
first level unordered list
second level unordered list
- third level unordered list
- first level unordered list
1 | + first level unordered list |
11. Dividing lines
Use ---
or***
or* * *
to show dividing lines
- Should more than three
-
---
/***
/* * *
should between two empty lines
demo:
1 |
|
12. Tables
default tables:
Heading | Heading | Heading |
---|---|---|
Cell | Cell | Cell |
Cell | Cell | Cell |
1 | Heading | Heading | Heading |
align tables:
Heading | Heading | Heading |
---|---|---|
Left | Center | Right |
Left | Center | Right |
1 | Heading | Heading | Heading |
13. emoji
Use :emoji code:
to show emoji in Markdown
Click here to see all of emoji codes
❗ Some editors do not support emoji code
It is recommended to enter emoji directly, Click here to view and copy emoji