mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
f3cc9308e0
The URL redirects, so without -L the command silently fails. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
2.6 KiB
Plaintext
66 lines
2.6 KiB
Plaintext
---
|
|
title: "Markdown export"
|
|
description: "Export clean Markdown versions of your documentation pages for AI tools, LLM integrations, and automated content processing workflows."
|
|
keywords: ["markdown", "token efficiency", "AI processing"]
|
|
---
|
|
|
|
import { PreviewButton } from "/snippets/previewbutton.jsx"
|
|
|
|
Markdown provides structured text that AI tools can process more efficiently than HTML, which results in better response accuracy, faster processing times, and lower token usage.
|
|
|
|
Mintlify automatically generates Markdown versions of pages optimized for AI tools and external integrations.
|
|
|
|
## .md URL extension
|
|
|
|
Add `.md` to any page's URL to view a Markdown version.
|
|
|
|
<PreviewButton href="https://mintlify.com/docs/ai/markdown-export.md">Open this page as Markdown</PreviewButton>
|
|
|
|
## Accept header
|
|
|
|
Send a request with `Accept: text/markdown` or `Accept: text/plain` to any page URL to receive the Markdown version instead of HTML. This is useful for AI tools and integrations that programmatically fetch documentation content.
|
|
|
|
```bash
|
|
curl -L -H "Accept: text/markdown" https://mintlify.com/docs/ai/markdown-export
|
|
```
|
|
|
|
## Audience-specific content
|
|
|
|
Use the [visibility](/components/visibility) component to customize content for each human and AI audiences.
|
|
|
|
Content wrapped in `<Visibility for="humans">` appears on the web page, but not in Markdown output. Content wrapped in `<Visibility for="agents">` appears in Markdown output, but not on the web page.
|
|
|
|
```mdx
|
|
<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>
|
|
```
|
|
|
|
## API reference pages
|
|
|
|
By default, Markdown exports of API reference pages include the full OpenAPI or AsyncAPI specification so AI tools have complete context about each endpoint.
|
|
|
|
If you prefer to omit the spec from Markdown output, set `markdown.schema` to `false` in your `docs.json`:
|
|
|
|
```json
|
|
"markdown": {
|
|
"schema": false
|
|
}
|
|
```
|
|
|
|
## Agent feedback
|
|
|
|
If you enable [agent feedback](/optimize/feedback#agent-feedback), Mintlify appends an `<AgentInstructions>` block to each page's Markdown export that tells agents how to submit feedback about the page's content.
|
|
|
|
Agents submit feedback by posting to the endpoint with the page path and feedback text.
|
|
|
|
Use agent feedback to improve your pages for agents based on what they find incorrect, outdated, or confusing.
|
|
|
|
## Keyboard shortcut
|
|
|
|
Press <kbd>Command</kbd> + <kbd>C</kbd> (<kbd>Ctrl</kbd> + <kbd>C</kbd> on Windows) to copy a page as Markdown to your clipboard.
|