# Markdown

<figure><img src="/files/6fc6b7879bc62cab9ffc86e7d81216b64ba3b0aa" alt="An image containing the markdown logo"><figcaption><p>在 GitBook 中编写 Markdown。</p></figcaption></figure>

GitBook 的编辑器允许你使用 Markdown 创建格式化内容。

Markdown 是一种广受欢迎的标记语法，以简洁著称。GitBook 支持它，作为一种更适合键盘操作的方式来编写丰富且结构化的文本。

{% hint style="info" %}
你可以通过访问以下内容来进一步了解 Markdown 本身 [常见标记](https://commonmark.org/help/).
{% endhint %}

### 文本格式化 <a href="#text-formatting" id="text-formatting"></a>

GitBook 支持所有经典的行内 Markdown 格式：

| 格式   | Markdown 版本 | 结果      |
| ---- | ----------- | ------- |
| 加粗   | `**粗体**`    | **粗体**  |
| 斜体   | `_斜体_`      | *斜体*    |
| 删除线  | `~删除线~`     | ~~删除线~~ |
| 行内代码 | `` `代码` ``  | `代码`    |

### 换行

按下 `Enter` 以开始新段落。

按下 `Shift` + `Enter` 以在同一段落中插入软换行。

### 粘贴 Markdown

当将 Markdown 内容直接粘贴到编辑器中时，使用 **粘贴并匹配样式** 选项非常重要（通常是 <kbd>Shift</kbd> + <kbd>Cmd</kbd> + <kbd>V</kbd> 在 Mac 上，或 <kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>V</kbd> 在 Windows 上）。

如果你使用标准的“粘贴”选项来粘贴从其他编辑器或网页复制的内容，它可能会被插入为代码块，而不是格式化文本。

### 标题

* 一级标题： `# 一级标题`
* 二级标题： `## 二级标题`
* 三级标题： `### 三级标题`

### 代码块

` ```⏎ ` 会创建一个新的代码块。

` ```py⏎ ` 会创建一个带有 Python 语法高亮的新代码块。

我们使用 [Prism](https://github.com/PrismJS/prism) 进行语法高亮。使用 [Test Drive Prism](https://prismjs.com/test.html#language=markup) 来查看支持的语言。

如果 GitBook 和 Prism 有所不同，可能是我们落后了一到两个版本。

### 列表

GitBook 会在你输入时自动检测并创建有序和无序列表。

* 以 `-` 或 `*` 开始一个无序项目符号列表。
* 以 `1.` 以开始一个编号列表。
* 以 `- [ ]` 以开始一个任务列表。

编写列表时，按 `Tab` 进行缩进，按 `Shift+Tab` 进行减少缩进。

### 引用

以 `>` 以创建块引用。如果你从头到尾选中整段文本，输入 `>` 会将内容包裹在块引用中。

> 这是一个块引用。

### 分隔线

输入 `---` 然后按 `Enter` 即可在页面上创建一条分隔线。

***

这是一个分隔线示例。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/creating-content/formatting/markdown.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
