Add llms.txt support to documentation#792
Merged
davidusb-geek merged 2 commits intoApr 23, 2026
Merged
Conversation
Add sphinx-llm extension to generate llms.txt, llms-full.txt and per-page Markdown files following the llms.txt standard. This enables AI tools and coding assistants to efficiently consume EMHASS docs. The extension integrates with the existing Sphinx/MyST build pipeline and Read the Docs serves the files automatically from the project root.
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR enables llms.txt support for the EMHASS documentation by adding the sphinx-llm extension to the Sphinx configuration and including its package in the docs optional dependencies, so that Read the Docs can automatically generate and serve LLM-friendly documentation artifacts. Sequence diagram for AI tool accessing llms.txt resourcessequenceDiagram
actor DevUser
participant AITool
participant Internet
participant ReadTheDocs
participant DocsArtifacts as Docs_artifacts
DevUser->>AITool: Configure docs_source_url
AITool->>Internet: Resolve emhass_readthedocs_url
Internet->>ReadTheDocs: DNS_and_routing
AITool->>ReadTheDocs: GET llms_txt
ReadTheDocs->>DocsArtifacts: Read llms_txt
DocsArtifacts-->>ReadTheDocs: llms_txt_content
ReadTheDocs-->>AITool: 200 llms_txt_content
AITool->>ReadTheDocs: GET llms_full_txt
ReadTheDocs->>DocsArtifacts: Read llms_full_txt
DocsArtifacts-->>ReadTheDocs: llms_full_txt_content
ReadTheDocs-->>AITool: 200 llms_full_txt_content
AITool->>DevUser: Provide_context_aware_suggestions
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
docs/conf.pythe Sphinx extension should likely be referenced as"sphinx_llm"(module name) rather than"sphinx_llm.txt", otherwise Sphinx may fail to load the extension. - Consider formatting the
extensionslist over multiple lines now that it has grown, to keep it readable and easier to modify in future.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `docs/conf.py` the Sphinx extension should likely be referenced as `"sphinx_llm"` (module name) rather than `"sphinx_llm.txt"`, otherwise Sphinx may fail to load the extension.
- Consider formatting the `extensions` list over multiple lines now that it has grown, to keep it readable and easier to modify in future.
## Individual Comments
### Comment 1
<location path="docs/conf.py" line_range="36" />
<code_context>
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-extensions = ["sphinx.ext.autodoc", "myst_parser", "sphinx_design"]
+extensions = ["sphinx.ext.autodoc", "myst_parser", "sphinx_design", "sphinx_llm.txt"]
myst_enable_extensions = [
</code_context>
<issue_to_address>
**issue (bug_risk):** The extension name `"sphinx_llm.txt"` looks like a potential typo or misconfiguration.
Sphinx expects extension entries to be importable module paths (e.g. `"sphinx_llm"`), not filenames. Using `.txt` here is likely to break the build because Sphinx won’t be able to import it. If you’re trying to enable the `sphinx-llm` package from `pyproject.toml`, this should probably be `"sphinx_llm"` (or the actual module name) instead of `"sphinx_llm.txt"`.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #792 +/- ##
=======================================
Coverage 81.91% 81.91%
=======================================
Files 10 10
Lines 5816 5816
=======================================
Hits 4764 4764
Misses 1052 1052 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Correct the package to sphinx-llms-txt (jdillard/sphinx-llms-txt) and the Sphinx extension module to sphinx_llms_txt. Previous sphinx-llm / sphinx_llm.txt referenced a different package and would not have been importable by Sphinx. Also format the extensions list over multiple lines for readability, per sourcery-ai review feedback.
davidusb-geek
approved these changes
Apr 23, 2026
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.
PR: Add llms.txt support to EMHASS documentation
Summary
This PR adds llms.txt support to the EMHASS documentation, enabling LLMs and AI coding assistants to efficiently consume the documentation at inference time.
Many EMHASS users already rely on AI tools (ChatGPT, Claude, Cursor, Copilot) to help configure and troubleshoot their setups. The
llms.txtstandard provides a structured, token-efficient way for these tools to access the full EMHASS documentation — resulting in better answers about configuration parameters, optimization modes, thermal models, and forecasting options.What is llms.txt?
The llms.txt standard is a proposed convention (similar to
robots.txtfor search engines) that provides LLM-friendly content. It generates:/llms.txt— A summary/sitemap of all documentation pages in Markdown/llms-full.txt— The entire documentation concatenated into a single Markdown file/*.html.md— Individual Markdown versions of each HTML pageThis is already adopted by projects like Anthropic, Vercel, Stripe, Cloudflare, and many others. Read the Docs natively supports serving these files.
Changes
1.
docs/conf.pyAdded
sphinx_llm.txtto the Sphinx extensions list:2.
pyproject.tomlAdded
sphinx-llmto thedocsoptional dependencies:3. No other changes required
llms.txt,llms-full.txt, and per-page.html.mdfiles during the normal Sphinx buildllms.txtfrom the project root — no.readthedocs.yamlchanges neededHow users benefit
After this change, users and AI tools can access:
https://emhass.readthedocs.io/llms.txthttps://emhass.readthedocs.io/llms-full.txthttps://emhass.readthedocs.io/en/latest/config.html.mdPractical use cases
https://emhass.readthedocs.io/llms-full.txtas context via@Docs→ better code suggestions for EMHASS automationsllms-full.txtURL for accurate configuration helpTesting
The extension works alongside the existing
myst_parsersetup (which already parses Markdown source files). Verified that:sphinx-llmis compatible withpydata-sphinx-themesphinx-llmis compatible withmyst_parserandsphinx_designRelated
Summary by Sourcery
Add llms.txt support to the Sphinx documentation build so that EMHASS docs are more easily consumed by LLMs and AI assistants.
Build: