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
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.
fixRun `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.
fixAdd `'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.