sphinx-llm¶
Make your docs readable by AI assistants and coding tools. sphinx-llm generates LLM-friendly versions of your documentation following the llms.txt convention — Lumina links to llms.txt automatically once the extension is enabled.
What It Produces¶
llms.txt— A markdown index of all pages with titles, URLs, and descriptionsllms-full.txt— The full content of every page concatenated into a single markdown filePer-page
.mdfiles — Each HTML page gets a companion markdown file (e.g.,getting-started.html.md)
Lumina Integration¶
Lumina automatically adds a <link rel="alternate"> tag in the HTML <head> pointing to llms.txt when this extension is detected — no extra configuration needed.
Setup¶
uv add sphinx-llm
extensions = ["sphinx_llm.txt"]
That’s it. On the next build, llms.txt, llms-full.txt, and per-page .md files appear alongside your HTML output.
Configuration¶
All options are optional — the defaults work well for most projects:
Option |
Default |
Description |
|---|---|---|
|
|
Master on/off switch. Disable with |
|
Auto-detected |
Project description shown in the |
|
|
Run the markdown build in parallel with the HTML build. |
|
|
Controls per-page markdown filenames. Options: |
|
|
Whether to generate |
How It Works¶
The extension runs a parallel Sphinx build using a markdown builder. All directives (including autodoc, toctree, cross-references) are fully expanded in the output — you get clean, rendered markdown, not raw source.
Each entry in llms.txt includes a description sourced from the page’s meta description or the first 100 characters of content.