Markdown 相关语法

# Markdown 相关语法

# 标题

# 标题一

## 标题二

<!-- 文本下方添加任意数量的 == 号也标识一级标题,或者 -- 号来标识二级标题  -->
标题一
======

标题二
------

### 标题三

#### 标题四

##### 标题五

标题

# 文字

# 加粗

要加粗文本,请在单词或短语的前后各添加两个星号(asterisks)或下划线(underscores)。如需加粗一个单词或短语的中间部分用以表示强调的话,请在要加粗部分的两侧各添加两个星号(asterisks)

this is **bold text1**.

this is __bold text2__

this is bold text1.

this is bold text2

# 斜体

要用斜体显示文本,请在单词或短语前后添加一个星号(asterisk)或下划线(underscore)。要斜体突出单词的中间部分,请在字母前后各添加一个星号,中间不要带空格

this is *Italic text1*

this is _Italic text2_

this is Italic text1

this is Italic text2

# 加粗斜体

要同时用粗体和斜体突出显示文本,请在单词或短语的前后各添加三个星号或下划线。要加粗并用斜体显示单词或短语的中间部分,请在要突出显示的部分前后各添加三个星号,中间不要带空格

this is ***Bold italic text1***

this is ___Bold italic text___

this is Bold italic text1

this is Bold italic text

# 删除线

你可以贯穿单词的中心放一条横线从而删除这些单词。其效果看起来是这样的: like this。此功能允许你标记某些单词是错误的,不应该出现在文档中。在单词前面和后面分别放置两个波浪号(~~) 来表示删除这些单词

~~this is Strikethrough~~

this is Strikethrough

# 块引用

要创建块引用,请在段落前添加一个 > 符号

> this is blockquote

<!-- 嵌套块引用 -->
> this is line 1
>
>> this is line 2

<!-- 包含其他元素的块引用 -->
> #### this is title
>
> - this is list1
> - this is list2
>
>  this is **Bold** *italic*.

this is blockquote

this is line 1

this is line 2

# this is title

  • this is list1
  • this is list2

this is Bold italic

# 列表

# 有序列表

要创建有序列表,请在每个列表项前添加数字并紧跟一个英文句点。数字不必按数学顺序排列,但是列表应当以数字 1 起始

1. First item
2. Second item
3. Third item
4. Fourth item

---

1. First item
2. Second item
3. Third item
    1. Indented item
    2. Indented item
4. Fourth item
  1. First item
  2. Second item
  3. Third item
  4. Fourth item

  1. First item
  2. Second item
  3. Third item
    1. Indented item
    2. Indented item
  4. Fourth item

# 无序列表

要创建无序列表,请在每个列表项前面添加破折号 (-)、星号 (*) 或加号 (+) 。缩进一个或多个列表项可创建嵌套列表

- First item
- Second item
- Third item
- Fourth item

---

- First item
- Second item
- Third item
    - Indented item
    - Indented item
- Fourth item
  • First item
  • Second item
  • Third item
  • Fourth item

  • First item
  • Second item
  • Third item
    • Indented item
    • Indented item
  • Fourth item

# 定义列表

First Term
: This is the definition of the first term.

Second Term
: This is one definition of the second term.
: This is another definition of the second term.

First Term : This is the definition of the first term.

Second Term : This is one definition of the second term. : This is another definition of the second term.

# 代码块

# 缩进代码块

代码块(Code blocks) 通常采用四个空格或一个制表符缩进。当它们被放在列表中时,请将它们缩进八个空格或两个制表符

代码块显示效果如下

<html>
	<head>
		<title>Test</title>
	</head>
</html>

# 围栏代码块

代码块的前后可以使用三个反引号(```)或三个波浪号(~~~)来标记围栏代码块

许多 Markdown 解析器都支持围栏代码块的语法高亮功能。此功能允许你为编写代码所用的编程语言添加带颜色的语法高亮显示。如需添加语法高亮,请在围栏代码块前的反引号旁指定所用的编程语言

	```md(文件格式)
	this is markdown
	```
	```js
	const a = 1;
	```
this is markdown
const a = 1;

# 链接

你可以选择为链接添加标题(即 title 属性)。当用户将鼠标悬停在链接上时,将显示一个提示。要添加标题,请将其放在 URL 后面

<!-- [链接描述](链接地址) -->
[百度一下](https://www.baidu.com "百度一下下下下")

百度一下 (opens new window)

# 网址或邮箱

要将 URL 或电子邮件地址快速转换为链接,请将其括在尖括号中

<https://www.baidu.com>
<my@qq.com>

https://www.baidu.com (opens new window) my@qq.com

# 格式化链接

<!-- 加粗 -->
**[百度一下](https://www.baidu.com)**

<!-- 斜体 -->
*[百度一下](https://www.baidu.com)*

<!-- 代码块样式 -->
[`百度一下`](#https://www.baidu.com)

百度一下 (opens new window) 百度一下 (opens new window) 百度一下

# 引用链接

[baidu]: https://www.baidu.com
[百度一下][baidu]

百度一下 (opens new window)

# 自动将链接转换

许多 Markdown 解析器会自动将 URL 转换为链接。这意味着,即使你没有 使用中括号,如果你输入 http://www.example.com,你的 Markdown 解析器也会自动将其转换为链接

http://www.example.com

http://www.example.com

# 禁止自动将 URL 转换为链接

如果你不希望自动将 URL 转换为链接,则可以通过反引号 将 URL 表示为代码

`http://www.example.com`

http://www.example.com

# 图片

<!-- \![这里是任意文字](这里是图片链接地址) -->
![任意图片描述](./p.png)

任意图片描述

# 带链接的图片

要为图片添加链接,请先为图片的 Markdown 标记添加一个方括号,然后紧跟着一个圆括号,并在圆括号中添加链接地址

[![点击图片跳转百度](./p.png "点击图片跳转百度")](https://www.baidu.com)

点击图片跳转百度 (opens new window)

# 表格

如需添加表格,请使用三个或更多个连字符(---)来为每个列创建表头,并使用管道符(|)来分隔每个列。你还可以在表格的任意一侧添加管道符

| Syntax      | Description |
| ----------- | ----------- |
| Header      | Title       |
| Paragraph   | Text        |

<!-- 通过在标题行中的连字符(hyphens)的左侧或右侧或两侧添加冒号(:),可以将对应列中的文本向左或向右或居中对齐 -->
| Syntax      | Description | Test Text     |
| :---        |    :----:   |          ---: |
| Header      | Title       | Here's this   |
| Paragraph   | Text        | And more      |
Syntax Description
Header Title
Paragraph Text
Syntax Description Test Text
Header Title Here's this
Paragraph Text And more

# 脚注

脚注(Footnotes)允许你添加注释(notes)和引用(references),而不会使文档正文混乱。当你创建脚注时,带有链接的上标数字会出现在你引用脚注的位置。 读者可以单击链接以跳转至页面底部的脚注内容处

this is footnote[^1]

[^1]: This is the first footnote.

this is footnote[^1]

[^1]: This is the first footnote.

# 任务列表

任务列表(task lists)允许你创建带有复选框的项目列表。在支持任务列表的 Markdown 应用程序中,复选框将显示在内容旁边。要创建任务列表,请在任务列表项前面添加破折号(-)和中间带空格的方括号([ ])。要选中复选框,请在方括号中间添加一个 x ,即([x])

- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media
  • [x] Write the press release
  • [ ] Update the website
  • [ ] Contact the media

# 表情符号

有两种方式可以将表情符号添加到 Markdown 文档中:将表情符号复制并粘贴到 Markdown 格式的文本中,或者键入 表情符号的简码(emoji shortcodes)

# 复制并粘贴表情符号

在大多数情况下,你可以简单地从 Emojipedia 等来源复制表情符号,然后将其粘贴到文档中。许多 Markdown 应用程序就会自动以 Markdown 格式的文本来显示表情符号。从 Markdown 应用程序导出的 HTML 和 PDF 文件也是可以显示表情符号的

# 使用表情符号的简码

某些 Markdown 应用程序允许你通过键入表情符号的简码(shortcodes)来插入表情符号。简码以冒号开头和结尾,两个冒号中间是表情符号的名称

Gone camping! :tent: Be back soon.

That is so funny! :joy:

Gone camping! ⛺️ Be back soon.

That is so funny! 😂

注意: 你可以使用这个 表情符号简码列表,但请记住,表情符号的简码随着 Markdown 应用程序的不同而不同。有关详细信息,请参阅你所使用的 Markdown 应用程序的文档。