Markdown 常用语法
简介
Markdown是一种轻量级的标记语言,可用于将格式设置元素添加到纯文本文档中。Markdown 由John Gruber于2004年创建,如今已成为世界上最受欢迎的标记语言之一。
Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档。
Markdown 语言在 2004 由约翰·格鲁伯(英语:John Gruber)创建。
Markdown 编写的文档可以导出 HTML 、Word、图像、PDF、Epub 等多种格式的文档。
Markdown 编写的文档后缀为 .md, .markdown
基本语法
标题
# H1
## H2
### H3
粗体
**bold text**
bold 粗体
斜体
*斜体*
斜体
块引用
>块引用
块引用
有序列表
1. First item
2. Second item
3. Third item
First item
Second item
Third item
First item
Second item
-
Third item
- Indented item
- Indented item
Fourth item
无序列表
- First item
- Second item
- Third item
First item
Second item
Third item
First item
Second item
-
Third item
- Indented item
- Indented item
Fourth item
代码
`code`
code
水平线
要创建水平线***,请单独在一行上使用三个或更多的星号(),破折号(---)或下划线(___)。
网址和电子邮件地址
要将URL或电子邮件地址快速转换为链接,请将其括在尖括号中。
<https://www.test.com>
<test@example.com>
超链接
[title](https://www.example.com)
图片

扩展语法
表格
| Syntax | Description |
| :----------- | :-----------: |
| Header | Title |
| Paragraph | Text |
Syntax | Description |
---|---|
Header | Title |
Paragraph | Text |
代码块
Markdown基本语法允许您通过将行缩进四个空格或一个制表符来创建代码块。如果发现不方便,请尝试使用受保护的代码块。根据Markdown处理器或编辑器的不同,您将在代码块之前和之后的行上使用三个刻度线(```)或三个波浪号(~~~)
{
"firstName": "james",
"lastName": "hu",
"age": 18
}
脚注
Here's a sentence with a footnote. [^1]
[^1]: This is the footnote.
Here's a sentence with a footnote. [1]
标题ID
### My Great Heading {#custom-id}
My Great Heading {#custom-id}
自定义列表
term
: definition
term
: definition
删除线
~~The world is flat.~~
The world is flat.
任务列表
- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media
- Write the press release
- Update the website
- Contact the media
转义字符
字符 | 名称 |
---|---|
|反斜杠 | |
` | 刻度线 |
* | 星号 |
_ | 下划线 |
{} | 大括号 |
[] | 中括号 |
() | 括号 |
# | 井号 |
+ | 加号 |
- | 减号(连字符) |
. | 点 |
! | 感叹号 |
管道 |
-
This is the footnote. ↩