Registry / web-framework / sphinx-external-toc

sphinx-external-toc

JSON →
library1.1.0pypypiunverified

Sphinx External ToC is a Sphinx extension that enables a top-down approach to defining the documentation's site-map (Table of Contents) using a single YAML file, typically `_toc.yml`. This contrasts with Sphinx's default bottom-up `toctree` directives spread across multiple reStructuredText files. The library is currently at version 1.1.0 and maintains an active release cadence, providing new features and bug fixes.

pip install sphinx-external-toc
INSTALL
IMPORT
SIG · SPHINX-EXTERNAL-TO
S
sphinx-external-toc
web-frameworkpythonv1.1.0
Install
5.7s avg
Import
Disk
98MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 95.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.7s · import 0.000s · 97MB
98MB installed
● package 98MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sphinx_external_toc
extensions = [ 'sphinx_external_toc', # Other extensions... ]
The extension is enabled by adding its module name to the 'extensions' list in conf.py.

To quickly set up `sphinx-external-toc`, first add `sphinx_external_toc` to your `extensions` list in `conf.py`. Then, create a `_toc.yml` file in your source directory to define your documentation structure. This YAML file replaces the need for `.. toctree::` directives within your ReStructuredText or Markdown files. The `external_toc_path`, `use_multitoc_numbering`, and `external_toc_exclude_missing` options provide granular control over the ToC generation.

# conf.py (in your Sphinx project's source directory) import os project = 'My Docs' copyright = '2026, My Name' extensions = [ 'sphinx_external_toc', 'myst_parser' # Example: if using Markdown ] # Optional: Configure the external ToC external_toc_path = '_toc.yml' # Default: '_toc.yml' use_multitoc_numbering = True # Default: True, enables numbered sections external_toc_exclude_missing = True # Default: False, prevents warnings for files not in ToC # --- Example _toc.yml (in your Sphinx project's source directory) --- # root: index # chapters: # - file: intro # - file: part1 # sections: # - file: part1/chapter1 # - file: part1/chapter2 # - file: tutorial # - url: https://example.com # title: External Link
Debug
Known issues
breakingVersion 0.3.0 dropped support for Python 3.6. Projects using older Python versions must upgrade their environment to Python 3.7+ (or 3.9+ for current versions).
fix
Upgrade your Python environment to 3.9 or newer. Ensure `requires_python='>=3.9'` is met.
affects: <0.3.0
breakingAs of v1.0.0, `sphinx-external-toc` explicitly requires `sphinx-multitoc-numbering`. Older installations that do not have this dependency might fail after upgrade.
fix
Ensure `sphinx-multitoc-numbering` is installed alongside `sphinx-external-toc` (e.g., `pip install sphinx-external-toc sphinx-multitoc-numbering`).
affects: >=1.0.0
gotchaChanges to the `_toc.yml` file, especially the `root` entry, may not always be reflected in the Sphinx build output unless the build cache is cleared.
fix
After modifying `_toc.yml`, clear your Sphinx build cache by deleting the `_build` directory (or using `make clean` if a Makefile is present) before rebuilding your documentation.
affects: All versions
gotchaBy default, Sphinx emits a 'WARNING: document isn't included in any toctree' for files not explicitly listed in your `_toc.yml`. While `sphinx-external-toc` manages the main ToC, explicitly unlisted files will still trigger this warning.
fix
To suppress this warning for documents intentionally excluded from the ToC, set `external_toc_exclude_missing = True` in your `conf.py`, or add `:orphan:` metadata to the top of each unlisted document file.
affects: All versions
gotchaVersion compatibility between `sphinx-external-toc` and Sphinx itself can be a source of issues. For example, v0.3.1 explicitly added support for Sphinx 5. Newer Sphinx versions might introduce incompatibilities with older `sphinx-external-toc` releases.
fix
Always check the `sphinx-external-toc` documentation and release notes for tested Sphinx versions. When encountering unexpected behavior, try updating `sphinx-external-toc` to its latest version, or pin its version to one known to be compatible with your Sphinx installation.
affects: All versions
Upgrade
Version history
1.1.0latest on PyPI · released Jan 16, 2026
Audit
Dependencies
sphinxrequiredCore documentation generator this extension integrates with.
pyyamlrequiredRequired for parsing the `_toc.yml` file.
sphinx-multitoc-numberingrequiredProvides advanced section numbering capabilities integrated with the external ToC.
clickrequiredUsed for the `sphinx-etoc` command-line interface.
Agent activity
4 hits · last 30 days
node
4
Resources
sphinx-external-toc — pip install sphinx-external-toc · libregistry