mkdocs-percona-llmstxt
An MkDocs plugin that makes Percona documentation sites easy for AI agents and assistants to read. It works together with mkdocs-llmstxt, which writes the files, and fills in everything a Percona docs repo would otherwise have to configure and maintain by hand.
A site built with both plugins gets:
llms.txt, an index of every page innav, grouped by the top-level nav sections, with links to the markdown pages (llms.txt proposal).llms-full.txt, all pages in one file (iffull_outputis set).- A markdown copy of every page next to its HTML:
backups.htmlandbackups.md. Each starts with a link tollms.txt. Content tabs keep their labels: each block starts with its label in bold. - Code blocks with their language:
```sqlinstead of a bare fence, so an agent knows what it is reading. - Links between pages that stay in markdown: a link to
other.htmlin a markdown page points atother.md. - Images keep their alt text: each image is replaced by
Image: <alt text>. - The version in the
llms.txttitle (# Percona Server for MySQL 8.4) (duringmike deploy; the first line ofllms-full.txtgets it too) and the groups in the label of a page nested below a section ("Audit Log Filter: Install"). - A link to
llms.txtin every HTML page, hidden on screen and from screen readers, and out of the tab order. The hidden text also gives the URL of the page's markdown copy, and the<head>has<link rel="alternate" type="text/markdown">to it. data-markdown-ignoreon the heading anchors (¶) and tab-label bars in the HTML. They are for people only; tools that compare a page's HTML with its markdown skip such elements.
Nothing changes for people reading the site.
Use
Python 3.11 or later. Add to requirements.txt:
mkdocs-llmstxt>=0.5.1,<0.6
mkdocs-percona-llmstxt>=0.4.0,<0.5
The plugin sets some of mkdocs-llmstxt's settings, so it supports one minor version of it at a time.
Add both plugins to mkdocs.yml (or mkdocs-base.yml):
plugins:
llmstxt:
full_output: llms-full.txt
markdown_description: >-
Each page below is also available as markdown. For the documentation
of all Percona products, see https://docs.percona.com/llms.txt.
sections: {} # mkdocs-llmstxt requires the key; percona-llmstxt fills it from nav
percona-llmstxt: {}
That's all. The links in llms.txt are built from site_url. A build without site_url, such as a PDF build that inherits the plugins from mkdocs-base.yml, is left as it is: no markdown pages and no changes to the HTML.
What it fills in
On the llmstxt plugin, unless mkdocs.yml already sets it:
| Setting | Value |
|---|---|
sections |
When empty ({}): one section per top-level nav group, in nav order. Top-level pages outside a group go into a first section, "Overview". External links are skipped. A page added to nav shows up in llms.txt with no other change. Pages that are built but not in nav, such as old release notes, go into a last section, "Optional": other pages link to them, so they get a markdown copy too, and in llms.txt "Optional" is the section an agent may skip when it is short of context. |
base_url |
site_url, plus the version during mike deploy. mike deploy 9.7 builds with MIKE_DOCS_VERSION=9.7, so https://docs.percona.com/percona-server/ becomes https://docs.percona.com/percona-server/9.7/. Each version branch links to its own pages, with no per-branch settings. |
preprocess |
Keeps the labels of content tabs, rewrites links to .md and keeps image alt text, then runs the plugin's usual clean-up (autoclean is turned off so that it does not run twice). Setting your own preprocess turns all three off. |
Markdown fidelity
- Code languages. The plugin turns on
pygments_lang_classforpymdownx.highlight(if you set it tofalseyourself, that is kept), so each fenced block in the markdown copy starts with its language. - Links. A link from one page to another in the site is rewritten to the markdown copy, with its
#anchorkept. Links to pages without a markdown copy are left alone. - Images. The images are removed from the markdown copy, as before, but their alt text stays as
Image: <alt text>; images with no alt text are dropped. - Version and labels. During
mike deploy, the version is added to thellms.txttitle and to the first line ofllms-full.txt. Inllms.txt, a page nested in one or more groups below its section is labelled with those groups, joined by ": ", such as "Audit Log Filter: Install". Pages directly in a section, top-level pages and nav entries without a title keep their own title. .html.mdcopies. Each markdown page is also written at its HTML URL plus.md(install.html.mdnext toinstall.md,foo/index.html.mdwith directory URLs), with the same content. llms.txt and the alternate link keep pointing to the.mdfiles.html_md: falseturns it off.- Descriptions. Each entry of
llms.txtgets: <description>unless it has one: thedescriptionin the page's front matter, or else the first sentence of the first paragraph that is directly in the page (not in an admonition, tab, table or list), cut at 200 characters with…. On a site that fillsdescriptionwith a plugin (such as meta-descriptions), that text is used, capped but not cut to one sentence. Space before punctuation left by inline links is tidied and HTML escapes in front matter are decoded. Descriptions under 15 characters, and any description shared by 3 or more pages (front matter included), are left out.descriptions: falseturns it off. - Optional section. With sections taken from
nav, the sections named inoptional_sections(defaultRelease notes, matched ignoring case; only top-level nav sections, not nested groups) are moved into the last section (other_pages, "Optional"), in nav order and ahead of the pages outside nav, and the labels of those that have a nav title start with the section name ("Release notes: Release notes index"). A nav group with the same name asother_pagesalso moves to the end. Withother_pages: ''orsectionsset by hand, nothing moves. - Alternate link. Each HTML page has
<link rel="alternate" type="text/markdown" href="...">in its<head>, and its hidden hint names the markdown URL.
Empty summary
site_description in mkdocs.yml becomes the > summary line of llms.txt. If it is empty or just says Documentation or docs, the build logs this warning and carries on (with --strict the build stops):
WARNING - site_description is the summary line of llms.txt; describe the product in one sentence
Options
percona-llmstxt:
first_section: Overview # section for top-level pages outside a nav group
other_pages: Optional # section for pages outside nav; '' leaves them out
hint: true # the hidden link to llms.txt in every HTML page
html_md: true # also write each markdown page as <page>.html.md
descriptions: true # add a one-line description to each llms.txt entry
optional_sections: [Release notes] # nav sections moved under the other_pages section; [] keeps them
Check a site
AFDocs scores a site against the Agent-Friendly Documentation spec:
npx afdocs check https://docs.percona.com/percona-operator-for-postgresql/latest/ --format scorecard
Develop
python -m pip install --require-hashes --no-deps -r requirements-dev.txt
python -m pip install --no-deps --no-build-isolation .
ruff check . && ruff format --check . && mypy && pytest
requirements-dev.txt pins the tools and their hashes. To update it, edit requirements-dev.in and follow the command at its top.
Release
- Set the new
versioninpyproject.tomland merge it tomain. - Tag that commit and push the tag:
git tag -a v0.4.1 -m v0.4.1 && git push origin v0.4.1.
The Release workflow builds the package, checks that the tag matches the version, publishes it to TestPyPI and then, once a maintainer approves the pypi environment, to PyPI. Both use trusted publishing, so the repo stores no PyPI tokens. Running the workflow by hand publishes to TestPyPI only.
License
Apache License 2.0.
Metadata
Release files for mkdocs-percona-llmstxt 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mkdocs_percona_llmstxt-0.4.1.tar.gz | 63.8 kB | With provenance | Details for mkdocs_percona_llmstxt-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mkdocs_percona_llmstxt-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for mkdocs_percona_llmstxt-0.4.1-py3-none-any.whl |
Total release size: 85.5 kB
Release files / mkdocs_percona_llmstxt-0.4.1.tar.gz
| Download URL | mkdocs_percona_llmstxt-0.4.1.tar.gz |
|---|---|
| Size | 63.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f6b75c528201ed82d67b6860da6c1b9e3c8d03aa066e1e84ca247a11628d4b1
|
|
BLAKE2b-256 checksum How to use checksums |
1404181af8b45e2d1a27ad635df6fe28a454cb3aa1416a8d01ea80cda87a38da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logRelease files / mkdocs_percona_llmstxt-0.4.1-py3-none-any.whl
| Download URL | mkdocs_percona_llmstxt-0.4.1-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b53988ef0a67a0ef10c0874ffb14bf70aeb8d3767e63faab05290b7b62eb02c
|
|
BLAKE2b-256 checksum How to use checksums |
3736e514d9c3826a789a3f646181bd5571ab92420eddd80a353ad1db3fbed7e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logSecurity for mkdocs-percona-llmstxt 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mkdocs_percona_llmstxt-0.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.