Skip to content

Publish llms.txt

The same Site Build that becomes your PDF manuals can also become the files AI assistants and coding agents read: an llms.txt index, an llms-full.txt with every page, and a Markdown copy beside each page. manuscrio-pdf llms writes all three, from the pages as they were built.

Terminal window
manuscrio-pdf llms ./build

It is free. llms needs no licence, and its output carries no watermark and no attribution.

FileContents
llms.txtThe site title and description, then a link to every page’s Markdown copy, in sidebar order: one heading per top-level sidebar group, categories nested beneath it, each page with its own description.
llms-full.txtEvery page in the same order, as Markdown, each headed with the URL it came from.
A .md file per pageEach page’s Markdown at the path of its HTML file: intro.html gets intro.md, and setup/index.html gets setup/index.md. Links between pages point at each other’s Markdown copies.

The Markdown is read from the built page, after Manuscrio has found the article exactly as it does for the PDF. What a reader sees is what an assistant gets:

  • content your Markdown source does not hold — partials, generated index pages, anything a component renders at build time;
  • every tab of a tabbed block, each under its own label, and the contents of every collapsible block;
  • code samples exactly as written, fenced so that a sample containing a fence of its own stays intact;
  • on Docusaurus, Mermaid diagrams as mermaid code blocks. The static page holds only an empty placeholder where a diagram is drawn, so Manuscrio recovers each one from the page’s compiled script.

Navigation, the table of contents, heading anchors and other page chrome are left out.

The command needs nothing added to your site: no plugin, no configuration change, no new dependency in its build.

llms.txt is found by convention at the root of the site, so the output belongs inside the directory you deploy. Generate it after the documentation build, copy it in, then deploy as usual:

Terminal window
npm run build # or: astro build, mkdocs build
manuscrio-pdf llms ./build # writes ./manuscrio-llms beside the Site Build
cp -R manuscrio-llms/. build/ # llms.txt at the root, each .md beside its page

That puts llms.txt at the root when the site has one edition. A versioned or translated site has several, and gets one llms.txt per edition in a subdirectory instead; add --edition to choose the one served at the root.

The output is written beside the Site Build rather than into it, as the PDFs are: the Site Build is only ever read. --output-dir names a different directory, and is refused inside the Site Build, where the next site build would erase it.

The links in llms.txt are absolute when Manuscrio knows the URL the site is served at. It reads that from the pages’ canonical links: Docusaurus always writes them, and Starlight and MkDocs do when the site’s own URL is configured (site in astro.config.mjs, site_url in mkdocs.yml). The command reports what it found:

llms: 92 pages from 1 edition(s) into /output
llms: site URL https://docs.example.com
llms: llms-full.txt 784 KiB, about 200k tokens

When there is no canonical link, the links are root-relative, which still resolve once the files are deployed. Give the URL to make them absolute:

Terminal window
manuscrio-pdf llms ./build --site-url https://docs.example.com

A site served below a path, such as /docs, keeps that path in its links either way.

Like export, llms reads every documentation edition by default, and never mixes two of them in one file. With a single edition, llms.txt and llms-full.txt are written at the top of the output directory. With several, each edition gets its own pair, in a subdirectory named after its ID (default-en-current for default:en:current), while the Markdown copies of every page share the one tree.

An llms.txt at the site root is usually meant to describe the current version in the main language. Select that edition, with an ID from inspect:

Terminal window
manuscrio-pdf llms ./build --edition default:en:current

--exclude-edition works as it does for export.

Add the step after the documentation build and before the deploy, so the files ship with the site:

- run: npm ci && npm run build
- name: Generate llms.txt
run: | # versioned or translated: add --edition <id>
npx --yes [email protected] llms build --output-dir manuscrio-llms
cp -R manuscrio-llms/. build/

Running the container directly, mount the Site Build read-only at /input and a writable directory at /output, exactly as for an export — see container invocation.