> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/mermaid-blocks.md).

# Mermaid 区块

Mermaid 块可让你使用 [Mermaid](https://mermaid.ai/) 语法。

当你想以易于更新的格式展示流程、顺序、状态或关系时，请使用它们。

### 添加 Mermaid 块

1. 将光标放在空白行上并输入 `/`.
2. 点击 **Mermaid** 在插入菜单中。
3. 输入或粘贴你的 Mermaid 语法。GitBook 会自动渲染图表。

你也可以点击 **+** 编辑器中任意行左侧的，然后点击 **Mermaid**.

### 示例

```mermaid
flowchart TD
    A[打开插入面板] --> B[选择 Mermaid]
    B --> C[添加 Mermaid 语法]
    C --> D[GitBook 渲染图表]
```

### Markdown 中的表示

````markdown
```mermaid
flowchart TD
    A[打开插入面板] --> B[选择 Mermaid]
    B --> C[添加 Mermaid 语法]
    C --> D[GitBook 渲染图表]
```
````

GitBook 会将带有 `mermaid` 语言标识符的代码块渲染为原生 Mermaid 块。<br>

### 故障排查

如果你的 Mermaid 图表未能渲染，请检查以下常见原因：

* **语法错误** — 检查你的 Mermaid 代码是否有拼写错误，将其与 Mermaid 文档中的示例进行比较，或者在 [Mermaid Live Editor](https://mermaid.live/) 中测试它以排查问题。
* **代码块而不是 Mermaid 块** — Mermaid 代码不会在标准代码块中渲染。按下 `/` 并选择 **Mermaid 图表** 以插入正确的块类型。
* **旧的 Mermaid 内容** — Mermaid 是原生块，因此无需集成。如果你在原生块支持之前创建了 Mermaid 内容，GitBook 会在你下次编辑页面时自动将其转换。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/mermaid-blocks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
