> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-docs-automation-github-pr-review.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Markdown 导出

> 将文档页面导出为整洁的 Markdown 格式，用于 AI 工具、LLM 集成和自动化内容处理工作流程。

export const PreviewButton = ({children, href}) => {
  return <a href={href} className="text-sm font-medium text-white dark:!text-zinc-950 bg-zinc-900 hover:bg-zinc-700 dark:bg-zinc-100 hover:dark:bg-zinc-300 rounded-full px-3.5 py-1.5 not-prose">
        {children}
      </a>;
};

与 HTML 相比，Markdown 提供的结构化文本更便于 AI 工具高效处理，从而带来更高的响应准确性、更快的处理速度，以及更低的 token 使用量。

Mintlify 会自动生成针对 AI 工具和外部 integrations 优化的页面 Markdown 版本。

<div id="md-url-extension">
  ## .md URL 后缀
</div>

在任意页面的 URL 末尾添加 `.md`，即可查看其 Markdown 版本。

<PreviewButton href="https://mintlify.com/docs/ai/markdown-export.md">以 Markdown 打开此页面</PreviewButton>

<div id="accept-header">
  ## Accept 标头
</div>

向任意页面 URL 发送带有 `Accept: text/markdown` 或 `Accept: text/plain` 的请求，即可接收 Markdown 版本而非 HTML。这对于以编程方式获取文档内容的 AI 工具和 integrations 非常有用。

```bash theme={null}
curl -L -H "Accept: text/markdown" https://mintlify.com/docs/ai/markdown-export
```

<div id="audience-specific-content">
  ## 面向特定受众的内容
</div>

使用 [visibility](/zh/components/visibility) 组件为人类和 AI 受众自定义内容。

用 `<Visibility for="humans">` 包裹的内容会显示在网页上，但不会出现在 Markdown 输出中。用 `<Visibility for="agents">` 包裹的内容会出现在 Markdown 输出中，但不会显示在网页上。

```mdx theme={null}
<Visibility for="humans">
  Click the **Get started** button in the top-right corner to create your account.
</Visibility>

<Visibility for="agents">
  To create an account, call `POST /v1/accounts` with a valid email address.
</Visibility>
```

<div id="api-reference-pages">
  ## API 参考页面
</div>

默认情况下，API 参考页面的 Markdown 导出包含完整的 OpenAPI 或 AsyncAPI 规范，以便 AI 工具能够获得每个端点的完整上下文。

如果你希望从 Markdown 输出中省略该规范，请在 `docs.json` 中将 `markdown.schema` 设置为 `false`：

```json theme={null}
"markdown": {
  "schema": false
}
```

<div id="agent-feedback">
  ## Agent 反馈
</div>

如果你启用了 [Agent 反馈](/zh/optimize/feedback#agent-feedback)，Mintlify 会在每个页面的 Markdown 导出中附加一个 `<AgentInstructions>` 块，告知 Agent 如何提交关于页面内容的反馈。

Agent 通过向端点发送页面路径和反馈文本来提交反馈。

使用 Agent 反馈根据 Agent 发现的不正确、过时或令人困惑的内容来改进你的页面。

<div id="authentication">
  ## 身份验证
</div>

Markdown 导出遵循与每个页面 HTML 版本相同的身份验证规则。

| 身份验证模式 | 行为                                                      |
| ------ | ------------------------------------------------------- |
| 无身份验证  | 所有 `.md` URL 均可公开访问。                                    |
| 部分身份验证 | 公共页面的 `.md` URL 可公开访问。受保护页面的 `.md` URL 需要身份验证，并遵循用户组限制。 |
| 完整身份验证 | 所有 `.md` URL 都需要身份验证，并遵循用户组限制。                          |

<div id="keyboard-shortcut">
  ## 键盘快捷键
</div>

按 <kbd>Command</kbd> + <kbd>C</kbd>（在 Windows 上为 <kbd>Ctrl</kbd> + <kbd>C</kbd>）将页面以 Markdown 格式复制到剪贴板。
