# Markdown

<figure><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FMbo91kXRJGPsIzXxsgpU%2Fmarkdown%402x.png?alt=media&#x26;token=9d812c93-81df-4bca-a053-baa88d83f572" 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 版本       | 结果      |
| ---- | ----------------- | ------- |
| 加粗   | `**bold**`        | **加粗**  |
| 斜体   | `_italic_`        | *斜体*    |
| 删除线  | `~strikethrough~` | ~~删除线~~ |
| 行内代码 | `` `code` ``      | `代码`    |

### 粘贴 Markdown

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

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

### 标题

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

### 代码块

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

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

{% hint style="info" %}
我们使用 [Prism](https://github.com/PrismJS/prism) 进行语法高亮。你可以使用 [Test Drive Prism](https://prismjs.com/test.html#language=markup) 来查看 Prism 支持哪些语言。如果你注意到 GitBook 和 Prism 之间存在不一致，有可能是因为我们的版本落后了一两个版本。我们很快就会跟上！
{% endhint %}

### 列表

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

* 以 `-` 或者 `*` 开始一行，以开始无序项目列表。
* 以 `1.` 以开始有序列表。
* 以 `- [ ]` 以开始任务列表。

{% hint style="info" %}
编写任何类型的列表时，按 `Tab` 以添加缩进，并按 `Shift+Tab` 以减少缩进。&#x20;
{% endhint %}

### 引用

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

> 这是一个块引用。

### 分隔线

输入 `---` 然后按 `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.
