Skip to main content

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 in nav, grouped by the top-level nav sections, with links to the markdown pages (llms.txt proposal).
  • llms-full.txt, all pages in one file (if full_output is set).
  • A markdown copy of every page next to its HTML: backups.html and backups.md. Each starts with a link to llms.txt. Content tabs keep their labels: each block starts with its label in bold.
  • Code blocks with their language: ```sql instead of a bare fence, so an agent knows what it is reading.
  • Links between pages that stay in markdown: a link to other.html in a markdown page points at other.md.
  • Images keep their alt text: each image is replaced by Image: <alt text>.
  • The version in the llms.txt title (# Percona Server for MySQL 8.4) (during mike deploy; the first line of llms-full.txt gets it too) and the groups in the label of a page nested below a section ("Audit Log Filter: Install").
  • A link to llms.txt in 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-ignore on 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_class for pymdownx.highlight (if you set it to false yourself, 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 #anchor kept. 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 the llms.txt title and to the first line of llms-full.txt. In llms.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.
  • 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

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

  1. Set the new version in pyproject.toml and merge it to main.
  2. Tag that commit and push the tag: git tag -a v0.4.0 -m v0.4.0 && git push origin v0.4.0.

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-percona-llmstxt 0.4.0
File Size Uploaded Provenance Actions
mkdocs_percona_llmstxt-0.4.0.tar.gz 56.4 kB With provenance Details for mkdocs_percona_llmstxt-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-percona-llmstxt 0.4.0
File Interpreter ABI Platform Actions
mkdocs_percona_llmstxt-0.4.0-py3-none-any.whl Python 3 none any Details for mkdocs_percona_llmstxt-0.4.0-py3-none-any.whl

Total release size: 74.4 kB

Release files / mkdocs_percona_llmstxt-0.4.0.tar.gz

Download URL mkdocs_percona_llmstxt-0.4.0.tar.gz
Size 56.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a2dc61b86df0a12b7a729dc1c72169c035cd5e5fcee92c5644ef50cad9f3f017
BLAKE2b-256 checksum
How to use checksums
fe6aa6a70c10ce1da0e76ea3877fac51bdf11f0f92b5e1c1fd78e10f29dc8a7d
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 log

Release files / mkdocs_percona_llmstxt-0.4.0-py3-none-any.whl

Download URL mkdocs_percona_llmstxt-0.4.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f1196fa840fc65add4b5d64a42b1087b46d1ac4df4b098033e3a4b595f3eaeb
BLAKE2b-256 checksum
How to use checksums
90dc1f4308928fefa8ddabc7f6a504f981916b9810e8032a512406c94d997c43
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 log

Security for mkdocs-percona-llmstxt 0.4.0

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.

Select from 2 files

Attestation for mkdocs_percona_llmstxt-0.4.0.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page