Registry / devops / sphinx-remove-toctrees

sphinx-remove-toctrees

JSON →
library1.0.0.post1pypypi✓ verified 83d ago

A Sphinx extension that allows you to remove toctrees from certain pages to reduce documentation build size. Current version: 1.0.0.post1. Maintained by the ExecutableBooks project, infrequent releases.

pip install sphinx-remove-toctrees
INSTALL
IMPORT
SIG · SPHINX-REMOVE-TOCT
S
sphinx-remove-toctrees
devopspythonv1.0.0.post1
Install
5.3s avg
Import
98ms
Disk
94MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0.post1 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.100s · 91.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.3s · import 0.096s · 92MB
94MB installed
● package 94MB
Code
Verified usage

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

sphinx_remove_toctrees
import sphinx_remove_toctrees
No common import mistakes; extension added via conf.py entry point, not direct import.

Enable the extension and configure which pages to remove toctrees from via the 'remove_toctrees_from' list.

extensions = ['sphinx_remove_toctrees'] # exclude specific pages from having toctrees remove_toctrees_from = ['page_to_remove.rst', 'another_page.rst']
Debug
Known issues
gotchaThe 'remove_toctrees_from' config value expects a list of document names (without .rst/.md extension) relative to source directory. Including extensions or full paths will silently fail.
fix
Use e.g. 'page_without_toctree' not 'source/page_without_toctree.rst'.
affects: all
gotchaThis extension removes the toctree directive from pages entirely, not just hiding it. Navigation may be affected if those pages are expected to display subpages.
fix
Only apply to pages where toctree is unnecessary (e.g., standalone content pages).
affects: all
deprecatedIn version 0.0.3, the configuration option was renamed from 'remove_toctrees_from' (previously 'exclude_toctrees'). The old name may still work but is undocumented.
fix
Use 'remove_toctrees_from' in conf.py.
affects: <0.0.3
Errors
Common errors & fixes
KeyError: 'remove_toctrees_from' not in config
Configuration option not defined in conf.py or misspelled.
fix
Add 'remove_toctrees_from = []' to conf.py even if empty, or check spelling.
WARNING: toctree is missing from page, but referenced in ...
Removing a toctree from a page that is included via another toctree may cause orphaned references.
fix
Ensure pages with removed toctrees are not listed as toctree entries elsewhere, or use Sphinx's 'orphan' directive.
Extension 'sphinx_remove_toctrees' has no setup() function
Wrong import or the package is not installed.
fix
Run 'pip install sphinx-remove-toctrees' and ensure conf.py has 'extensions = ['sphinx_remove_toctrees']'.
Upgrade
Version history
1.0.0.post1latest on PyPI · released Mar 22, 2024
Audit
Dependencies
sphinxrequiredRequired extension.
Agent activity
11 hits · last 30 days
node
10
Resources
sphinx-remove-toctrees — pip install sphinx-remove-toctrees · libregistry