下面简单的记录一下常用的一些 Markdown 语法:
# 一、Markdown 语法
# 1、文本类语法
| 元素 | 语法 | HTML |
|---|---|---|
| 标题(Heading) | # H1## H2### H3 | <h1></h1><h2></h2><h3></h3> |
| 代码(Code) | `code` | <code>code</code> |
| 粗体(Bold) | **bold text** | <strong>bold text</strong> |
| 斜体(Italic) | *italicized text* | <em>italicized text</em> |
| 删除线(Strikethrough) | ~~The world is flat.~~ | |
| 脚注(Footnote) | ||
# 2、结构类语法
| 元素 | 语法 | HTML |
|---|---|---|
| 引用块(Blockquote) | > blockquote | |
| 无序列表(Unordered List) | - First item- Second item- Third item | <ul><li>First item</li><li>Second item</li><li>Third item</li></ul> |
| 链接(Link) | [title](https://www.example.com) | <a href='https://www.example.com'>title</a> |
| 分隔线(Horizontal Rule) | --- | <hr> |
| 有序列表(Ordered List) | 1. First item2. Second item3. Third item | <ol><li>First item</li><li>Second item</li><li>Third item</li></ol> |
| 图片(Image) |  |
# 3、列表
1. First item
- First item
- item
- Second item
> item
2. Second item
3. Third item
- First item
- First item
- item
- Second item
item
- First item
- Second item
- Third item
# 4、代码块
```
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
```
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
# 5、表格
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
| Syntax | Description |
|---|---|
| Header | Title |
| Paragraph | Text |
# 二、vuepress 中使用
下面标注 ✖ 表示 vuepress 中不支持的 Markdown 语法,标准 ✔ 表示 vuepress 的 Markdown 拓展语法
# 容器 ✔
::: tip
这是一个提示
:::
::: warning
这是一个警告
:::
::: danger
这是一个危险警告
:::
::: details
这是一个详情块,在 IE / Edge 中不生效
:::
TIP
这是一个提示
WARNING
这是一个警告
WARNING
这是一个危险警告
DETAILS
这是一个详情块,在 IE / Edge 中不生效
# 1、高亮 ✖
==高亮==
==高亮==
# 2、任务列表 ✖
- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media
- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media
# 3、脚注 ✖
Here's a sentence with a footnote. [^1]
// 内容
[^1]: This is the footnote.
Here's a sentence with a footnote. [^1]
[^1]: This is the footnote.