.md URL extension
Add.md to any page’s URL to view a Markdown version.
Open this page as Markdown
Links to other pages in your navigation point to their Markdown versions, so agents that follow a link keep reading Markdown. For example, [Quickstart](/quickstart#install) becomes [Quickstart](/quickstart.md#install) in the Markdown output. Links to pages that are not in your navigation, images, external URLs, and links inside code blocks stay as written.
Accept header
Send a request withAccept: 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.
Missing pages
If you request a page that doesn’t exist as Markdown, Mintlify returns a 404 status with a Markdown body that helps AI tools recover. The response links to your documentation index (llms.txt), your full documentation file (llms-full.txt), and up to three related pages based on the requested path.
Example Markdown 404 response
Audience-specific content
Use the visibility component to customize content for 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.
Components and HTML
Markdown export converts components and HTML into Markdown before an agent reads the page. The web page does not change.Components
A component without its own Markdown form keeps its text. Its
title becomes bold, or a link when it also has an href, and its description or children follow.
Variation and View stay as tags, because they select content rather than display it.
HTML
HTML in a page becomes Markdown too.- Removes wrappers such as
divandspan. Their content stays. - Headings, links, images, and bold, italic, or code text become Markdown.
- Removes
class,className,style, anddata-*attributes.id,href,src,alt, and ARIA attributes stay. - When a light-only image (
dark:hidden) sits next to a dark-only image (hiddenwithdark:block,dark:inline,dark:inline-block,dark:flex, ordark:grid), the dark copy is not included. A dark-only image with no light copy next to it stays.
aria-label, then the title, then Open.
Snippets
Snippets render the content of the imported file, not the tag such as<Snippet file="path/to/snippet.mdx" />. Markdown exports include any variables from docs.json. If a referenced snippet file isn’t found, the Markdown export includes the tag.
<Visibility> inside a snippet or a custom component follows the same audience rules as on the page. Use it when a custom component is visual and you want agents to read a simpler form, such as a Card.
Custom React components
Markdown exports never include component source code. When a page imports custom React components or data from snippet files, the Markdown export contains what those components display, not the code that defines them.- Components with static output render as Markdown. For example, a component that returns a link, a list, or a table appears as that link, list, or table.
- Interactive components build their output from state or browser APIs, such as calculators, filterable galleries, and charts. They keep only their children and their
title,description,alt, andhrefprops. A component with none of these is omitted. - Imported data, such as an object passed to a component as a prop, does not appear in Markdown exports.
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, setmarkdown.schema to false in your docs.json:
Custom agent instructions
To append your own guidance to the Markdown that Mintlify serves to AI agents, setmarkdown.instructions in your docs.json. Use it for site-wide directions like citing an API version, preferring a specific SDK, or following your terminology.
Provide a single string:
Example agent instructions string
Example agent instructions array
Agent Instructions block in the Markdown output:
Example rendered agent instructions
- The Markdown export of every page, including API reference pages.
- Your
llms.txtfile, after the site title and description. - Your
llms-full.txtfile.