Skip to main content

sphinx-llm-friendly

Sphinx extension that makes documentation LLM-friendly:

  • A Markdown version of every page, next to its HTML version.

  • llms.txt, with a link to the Markdown version of every page.

  • HTML pages point to their Markdown version with a <link rel="alternate" type="text/markdown"> tag, and get a button to copy their Markdown version.

Setup

  1. Install it:

    pip install sphinx-llm-friendly
  2. Add it to extensions in conf.py:

    extensions = [
        # …
        "sphinx_llm_friendly",
    ]
  3. Build your documentation with the html builder:

    sphinx-build -b html docs docs/_build/html

    The Markdown pages and llms.txt are written next to the HTML pages. In the Markdown output, links to sites from intersphinx_mapping that serve Markdown point to the Markdown version of their pages, and references to Python built-ins, such as str, are plain text.

Configuration

llm_friendly_exclude

List of patterns, with the syntax of exclude_patterns, of documents to leave out of the Markdown output and llms.txt. Default: [].

llm_friendly_llms_txt_summary

Summary for llms.txt. Default: the first paragraph of the root document.

llm_friendly_llms_txt_toctree_only

If True, llms.txt only lists documents reachable through toctrees from the root document. Default: False.

To leave content out of the Markdown output, give it the llm-friendly-exclude class, e.g. with the container directive. For a sphinx-design tab, use the class-label or class-content option of tab-item.

For the Markdown output, the only directive evaluates its expression with the llm tag instead of html, e.g. use .. only:: llm for content to include only in the Markdown output, and .. only:: not llm for content to leave out of it.

Nodes from third-party extensions that are still in the doctree when HTML is written need Markdown handlers, registered with app.add_node() as llm_markdown.

Metadata

Release files for sphinx-llm-friendly 0.7.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 sphinx-llm-friendly 0.7.0
File Size Uploaded
sphinx_llm_friendly-0.7.0.tar.gz 58.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-llm-friendly 0.7.0
File Interpreter ABI Platform
sphinx_llm_friendly-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 85.7 kB

Release files / sphinx_llm_friendly-0.7.0.tar.gz

Download URL sphinx_llm_friendly-0.7.0.tar.gz
Size 58.5 kB
Tags Source
SHA-256 checksum
How to use checksums
01fd1581b6d0059bd44fb32512203ebc98921e5a56b40a7814f49e3fcac69326
BLAKE2b-256 checksum
How to use checksums
2ac05963bf632f8615b475a98c4d43b5f672a7a84572a44694738b374dd0c0d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / sphinx_llm_friendly-0.7.0-py3-none-any.whl

Download URL sphinx_llm_friendly-0.7.0-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f18fa8b475a27e3a9cb268233e87847bbe26e62575761478d62ec8d33309ffbd
BLAKE2b-256 checksum
How to use checksums
6c14de1443ed85519f3d005e477c7ff075706eaa4dc20db1a217abac5b76e264
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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