# 文档内容模板 (/zh/guides/content-templates)

<!-- agent-signals: reading_time_min: 4 · est_tokens: 1932 · updated: 2026-07-30 -->

使用这些模板作为创建文档的起点。根据你的文档和受众对模板进行自定义。

1. 复制与你的内容类型匹配的模板。
2. 将占位符和示例内容替换为你的实际内容。
3. 按需调整各个部分。
4. 删除任何不适用的部分。

<Tip>
  不确定该使用哪个模板？阅读 [内容类型](/zh/guides/content-types) 以了解每种模板适用的场景。
</Tip>

<div id="how-to-guide-template">
  ## 操作指南模板 [#操作指南模板]
</div>

当用户需要完成某项特定任务且已经对你的产品有一定了解时，应使用操作指南。操作指南以目标为导向，直奔解决方案。

````mdx title="How-to guide template"
---
title: "[标题应以动词开头]"
description: "[执行特定任务]以[达成结果]。"
---

以简短的陈述开始，说明本指南帮助用户完成什么任务。

## 前置条件（可选）

仅列出必要的内容：

- 必需的设置或配置
- 所需的权限
- 应首先配置的相关功能

## [描述任务的行动导向标题]

提供专注于实现目标的直接说明。

1. 打开[位置]并导航到[特定位置]
2. 点击[按钮或选项]
3. 输入[必填信息]
4. 点击[确认按钮]

```language
// Include code examples that users can copy and modify
```

<Tip>
  Include practical tips that help users avoid common mistakes or work more efficiently.
</Tip>

## Verify the result (optional)

If success is ambiguous, explain how users can confirm they completed the task successfully.

## Troubleshooting (optional)

Address common issues users might encounter:

- **Problem description**: Solution or workaround
- **Another common issue**: How to resolve it

## Related tasks

Link to related how-to guides or next steps.
````

<div id="tutorial-template">
  ## 教程模板 [#教程模板]
</div>

当你希望通过实践操作来帮助新用户学习时，请使用教程。教程会一步步引导用户，完成一个具有清晰结果的完整学习过程。

````mdx title="Tutorial template"
---
title: "[动作动词] [具体结果]"
description: "了解如何通过[方法或途径]实现[具体结果]。"
---

使用介绍段落说明用户可以期望学到什么，以及完成本教程后他们能做什么。

## 前提条件

列出用户在开始之前需要具备的条件：

- 所需知识或技能
- 工具、账户或权限
- 时间投入（可选）

## 步骤 1：[第一个操作]

为第一步提供清晰、具体的说明。

```language
// Include code examples where helpful
```

解释此步骤完成了什么以及为什么重要。

## 步骤 2：[第二个操作]

继续按顺序执行基于前面工作的步骤。

指出里程碑和进度标记，让用户知道他们在正确的轨道上。

## 步骤 3：[第三个操作]

保持步骤专注于具体操作而非理论。

尽量减少用户需要做出的选择。

## 后续步骤

总结用户所学内容并建议合理的后续步骤：

- 可尝试的相关教程
- 常见任务的操作指南
- 用于深入学习的额外资源
````

<div id="explanation-template">
  ## 说明模板 [#说明模板]
</div>

当用户需要理解概念、设计决策或复杂功能的工作机制时，使用说明类内容。说明类内容用于提供上下文并加深理解，而不是给出一步一步的操作指引。

```mdx title="Explanation template"
---
title: "关于 [概念或功能]"
description: "了解 [概念] 及其在 [产品或上下文] 中的工作原理。"
---

首先明确说明本文档涵盖的内容以及理解它的重要性。

用通俗易懂的语言定义概念。解释它是什么、有什么作用以及为什么存在。

必要时使用类比或与熟悉概念的对比来帮助理解。

## [概念] 的工作原理

解释底层机制、架构或流程。

<Frame>
  <img src="/path/to/diagram.png" alt="显示 [概念] 工作原理的图表" />
</Frame>

将复杂的概念分解为易于理解的部分。

## 为什么采用 [设计决策或方法]

提供关于事物为何以这种方式工作的背景信息。

讨论权衡取舍、考虑过的替代方案或影响设计的约束条件。

## 何时使用 [概念]

帮助用户了解何时最适合使用此概念或方法。

- **用例 1**:适合使用此方法的场景
- **用例 2**:另一个适合选择此方法的场景
- **不推荐用于**:替代方案更优的情况

## 与其他功能的关系

建立与产品中相关概念或功能的联系。

解释此概念如何融入更广泛的系统或工作流程。

## 常见误解

澄清误解或阐明细微差别。

## 延伸阅读

链接到相关说明、教程或参考文档。
```

<div id="reference-template">
  ## 参考模板 [#参考模板]
</div>

当用户需要查找产品功能的具体细节时，请使用参考文档。编写参考文档时，应优先考虑其准确性、一致性和便于快速浏览。

````mdx title="Reference template"
---
title: "[Feature or API name] reference"
description: "Complete reference for [feature or API] properties, parameters, and options."
---

Provide a one-sentence description of what this feature or API does.

## Properties

<ParamField body="property1" type="string" required>
  Brief description of the property.
</ParamField>

<ParamField body="property2" type="number">
  Brief description with default value if applicable.
</ParamField>

<ParamField body="property3" type="boolean" default="false">
  Brief description.
</ParamField>

## Parameters

<ParamField body="parameterName" type="string">
  Description of what this parameter does and when to use it.

```language
// Example showing typical usage
```
</ParamField>

<ParamField body="anotherParameter" type="object">
  参数的说明。

  可用选项:

  - `option1`: 此选项的说明。
  - `option2`: 此选项的说明。
</ParamField>

## Examples

### Basic example

```language title="Basic usage"
// Minimal example showing common use case
```

### Advanced example

```language title="Advanced configuration"
// Example with multiple options configured
```

## Response

If documenting an API, describe the response structure.

<ResponseField name="field1" type="string" required>
  Description of the response field.
</ResponseField>

<ResponseField name="field2" type="number">
  Description of another response field.
</ResponseField>

Example response:

```json
{
  "field1": "value",
  "field2": 123
}
```

## Related references

Link to related reference documentation.
````

<div id="related-pages">
  ## 相关页面 [#相关页面]
</div>

<CardGroup cols="2">
  <Card title="内容类型" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M4 8C6.20914 8 8 6.20914 8 4C8 3.2722 8 2.90829 8.02385 2.80107C8.13266 2.31172 8.28121 2.16103 8.76894 2.0452C8.87582 2.01982 9.08666 2.01679 9.50835 2.01074C10.2571 2 11.084 2 12 2C13.3714 2 14.5433 2 15.5518 2.03606C15.9598 2.05065 16.1639 2.05794 16.2867 2.09469C16.7096 2.22123 16.8563 2.37333 16.9677 2.80046C17 2.92452 17 3.28301 17 4C17 6.20914 18.7909 8 21 8C21.4931 8 21.963 8.34313 21.9759 8.83609C22 9.75428 22 10.8009 22 12C22 12.916 22 13.7429 21.9893 14.4916C21.9832 14.9133 21.9802 15.1242 21.9548 15.2311C21.839 15.7188 21.6883 15.8673 21.1989 15.9762C21.0917 16 20.7278 16 20 16C17.7909 16 16 17.7909 16 20C16 20.7278 16 21.0917 15.9762 21.1989C15.8673 21.6883 15.7188 21.839 15.2311 21.9548C15.1242 21.9802 14.9133 21.9832 14.4917 21.9893C13.7429 22 12.916 22 12 22C11.084 22 10.2571 22 9.50835 21.9893C9.08666 21.9832 8.87582 21.9802 8.76894 21.9548C8.28121 21.839 8.13266 21.6883 8.02385 21.1989C8 21.0917 8 20.7278 8 20C8 17.7909 6.20914 16 4 16C3.27219 16 2.90829 16 2.80106 15.9762C2.31172 15.8673 2.16103 15.7188 2.0452 15.2311C2.01982 15.1242 2.01679 14.9133 2.01074 14.4916C2 13.7429 2 12.916 2 12C2 11.084 2 10.2571 2.01074 9.50835C2.01679 9.08666 2.01982 8.87582 2.0452 8.76894C2.16103 8.28121 2.31172 8.13266 2.80107 8.02385C2.90829 8 3.2722 8 4 8Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/guides/content-types">
    根据文档目标选择合适的内容类型。
  </Card>

  <Card title="风格和语气" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M3.49977 18.9853V20.5H5.01449C6.24074 20.5 6.85387 20.5 7.40518 20.2716C7.9565 20.0433 8.39004 19.6097 9.25713 18.7426L19.1211 8.87868C20.0037 7.99612 20.4449 7.55483 20.4937 7.01325C20.5018 6.92372 20.5018 6.83364 20.4937 6.74411C20.4449 6.20253 20.0037 5.76124 19.1211 4.87868C18.2385 3.99612 17.7972 3.55483 17.2557 3.50605C17.1661 3.49798 17.0761 3.49798 16.9865 3.50605C16.4449 3.55483 16.0037 3.99612 15.1211 4.87868L5.25713 14.7426C4.39004 15.6097 3.9565 16.0433 3.72813 16.5946C3.49977 17.1459 3.49977 17.759 3.49977 18.9853Z&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M13.5 6.5L17.5 10.5&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/guides/style-and-tone">
    以一致的风格撰写高效的文档。
  </Card>

  <Card title="格式化文本" icon="<svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22;><path d=&#x22;M15 21.001H9&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/><path d=&#x22;M12 3.00001V21.0008M12 3.00001C13.3874 3.00001 15.1695 3.03055 16.5884 3.17649C17.1885 3.2382 17.4886 3.26906 17.7541 3.37791C18.3066 3.60429 18.7518 4.10063 18.9194 4.67681C19 4.95382 19 5.26992 19 5.90215M12 3.00001C10.6126 3.00001 8.83047 3.03055 7.41161 3.17649C6.8115 3.2382 6.51144 3.26906 6.24586 3.37791C5.69344 3.60429 5.24816 4.10063 5.08057 4.67681C5 4.95382 5 5.26992 5 5.90215&#x22; stroke=&#x22;currentColor&#x22; stroke-linecap=&#x22;round&#x22; stroke-width=&#x22;1.5&#x22;/></svg>" href="/zh/create/text">
    了解如何格式化文本并设置内容样式。
  </Card>
</CardGroup>
