Add built-in llms_txt plugin - #105
Merged
Merged
Conversation
Publish the documentation for LLMs and coding agents, following the llms.txt proposal (https://llmstxt.org/): - A Markdown version of every page, at the page's source path (so relative links between pages keep working). It is the page's Markdown after plugins have processed it, without front matter, starting with the page's title. - An `llms.txt` index at the site root: `site_name` as the title, `site_description` as the summary, and links to the Markdown pages grouped by navigation section, with the pages' `description` metadata as notes. Links are absolute when `site_url` is set. - With `full_output: true`, an `llms-full.txt` with all pages in navigation order. Draft pages, external links and anchor links are left out. The plugin is not enabled by default; enable it with `plugins: [search, llms_txt]`. The upcoming release is renamed to 2.0.0 in the release notes. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a built-in
llms_txtplugin that publishes the documentation for LLMs and coding agents, following the llms.txt proposal. It is not enabled by default:Output
docs/guide/install.md→site/guide/install.md. Because the layout mirrorsdocs/, relative links between pages keep working. For index pages and withuse_directory_urls: false, these paths match the llms.txt v2 convention (…/index.md,page.mdnext topage.html). The content is the page's Markdown after other plugins have processed it (macros and snippets are expanded), without front matter, and starting with the page's title when the page has no H1 of its own.llms.txtat the site root:site_nameas the H1,site_descriptionas the summary, and links to the Markdown pages grouped by navigation section (## Guide,## Guide / More; top-level pages under## Pages). A page'sdescriptionmetadata becomes the link's note. Links are absolute whensite_urlis set, relative otherwise.llms-full.txt(withfull_output: true): all pages in navigation order in a single file.Draft pages, external links and anchor links are left out.
Design notes
:::blocks) appears in its source form. The docs say so.llms_txtso it doesn't clash with thellmstxtentry point of the third-partymkdocs-llmstxtpackage.Verification
mkdocs/tests/llms_txt_tests.pycovers the fullllms.txtoutput, the per-page Markdown,llms-full.txt,site_urlwith URL quoting, and path mapping.llms.txt, and a 330 KBllms-full.txt, with a--strictbuild.Known follow-up:
mkdocs get-depsdoesn't knowllms_txtis built in, because themkdocs-get-depspackage hardcodessearchas the only built-in plugin, so it reportsllms_txtas unknown.The release notes rename the upcoming release to 2.0.0.
Related Issue
No issue in this repository.
Checklist
docs/about/release-notes.mdupdated (if applicable)🤖 Generated with Claude Code