跳转到主要内容
与 HTML 相比,Markdown 提供的结构化文本更便于 AI 工具高效处理,从而带来更高的响应准确性、更快的处理速度,以及更低的 token 使用量。 Mintlify 会自动生成针对 AI 工具和外部 integrations 优化的页面 Markdown 版本。

.md URL 后缀

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

Accept 标头

向任意页面 URL 发送带有 Accept: text/markdownAccept: text/plain 的请求,即可接收 Markdown 版本而非 HTML。这对于以编程方式获取文档内容的 AI 工具和 integrations 非常有用。
curl -H "Accept: text/markdown" https://mintlify.com/docs/ai/markdown-export

面向特定受众的内容

使用 visibility 组件为人类和 AI 受众自定义内容。 <Visibility for="humans"> 包裹的内容会显示在网页上,但不会出现在 Markdown 输出中。用 <Visibility for="agents"> 包裹的内容会出现在 Markdown 输出中,但不会显示在网页上。
<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>

键盘快捷键

Command + C(在 Windows 上为 Ctrl + C)将页面以 Markdown 格式复制到剪贴板。