A Sphinx extension that generates a summary llms.txt
file, written in Markdown, and a single combined documentation llms-full.txt
file, written in reStructuredText.
pip install sphinx-llms-txt
- Add the extension to your Sphinx configuration (
conf.py
):
extensions = [
'sphinx_llms_txt',
]
- Type: boolean
- Default:
'True'
- Description: Whether to write the single output file
- Type: string
- Default:
'llms-full.txt'
- Description: Name of the single output file
- Type: integer or
None
- Default:
None
(no limit) - Description: Sets a maximum line count for
llms_txt_full_filename
. If exceeded, the file is skipped and a warning is shown, but the build still completes.
- Type: boolean
- Default:
True
- Description: Whether to write the summary information file
- Type: string
- Default:
llms.txt
- Description: Name of the summary information file
- Type: list of strings
- Default:
[]
- Description: List of custom directive names to process for path resolution.
- Type: string or
None
- Default:
None
- Description: Overrides the Sphinx project name as the heading in
llms.txt
.
- Type: string or
None
- Default:
None
- Description: Optional, but recommended, summary description for
llms.txt
.
- Type: list of strings
- Default:
[]
- Description: A list of pages to ignore (e.g.,
["page1", "page_with_*"]
).
- Creates
llms.txt
andllms-full.txt
- Automatically add content from
include
directives - Resolves relative paths in directives like
image
andfigure
to use full paths- Ability to add list of custom directives with
llms_txt_directives
- Optionally, prepend a base URL using Sphinx's
html_baseurl
- Ability to add list of custom directives with
- Ability to exclude pages
MIT License - see LICENSE file for details.