Registry / serialization / autoclasstoc

autoclasstoc

JSON →
library1.7.0pypypi✓ verified 84d ago

Add a succinct table of contents to Sphinx auto-documented classes, making navigation easier. Version 1.7.0, stable and infrequently updated.

pip install autoclasstoc
INSTALL
IMPORT
SIG · AUTOCLASSTOC
A
autoclasstoc
serializationpythonv1.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

autoclasstoc
from sphinx.ext.autodoc import cut_lines, between # The extension is loaded via conf.py extensions list, not direct import.
The library is a Sphinx extension; it is not meant to be imported in Python code. Instead, add 'autoclasstoc' to the `extensions` list in your conf.py.
autoclasstoc directive
.. autoclasstoc::
.. automodule:: :members: :noindex:
Common mistake: using `automodule` instead of `autoclasstoc`. The directive is `.. autoclasstoc::` with options like `:ignore:`.

Enable the extension in conf.py, then use the `.. autoclasstoc::` directive in your RST to generate a table-of-contents for auto-documented class members.

extensions = ['sphinx.ext.autodoc', 'autoclasstoc'] # In your .rst file: # .. autoclasstoc:: # :ignore: __init__ # :order: source # :sections: Attributes, Methods # Then use .. autoclass:: to document a class and the TOC appears.
autoclasstoc --version
Debug
Known issues
gotcha`autoclasstoc` requires `sphinx.ext.autodoc` to be loaded first. If not, the extension silently fails.
fix
Ensure `extensions` list has `'sphinx.ext.autodoc'` before `'autoclasstoc'`.
affects: all
gotchaThe `:ignore:` directive does not work with parenthesized names like `__init__(self)`. Use just `:ignore: __init__` (no parentheses).
fix
List method names without arguments.
affects: all
deprecatedThe `:members:` option on `autoclasstoc` is deprecated and may be removed. It is ignored in modern versions.
fix
Remove `:members:` from the `autoclasstoc` directive; it has no effect.
affects: >=1.6
Errors
Common errors & fixes
Extension error: Could not import extension autoclasstoc (exception: No module named 'autoclasstoc')
`autoclasstoc` is not installed in the Python environment used by Sphinx.
fix
Run `pip install autoclasstoc` in the same environment as Sphinx.
WARNING: unknown directive: autoclasstoc
The extension is not enabled in conf.py or is listed after a broken extension.
fix
Add `'autoclasstoc'` to the `extensions` list and ensure `sphinx.ext.autodoc` is also present.
Upgrade
Version history
1.7.0latest on PyPI · released Oct 15, 2024
Audit
Dependencies
sphinxrequiredRequired to use the `autoclasstoc` directive in Sphinx builds.
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
1
Resources
autoclasstoc — pip install autoclasstoc · libregistry