autodocsumm
autodocsumm is a Sphinx extension that enhances `sphinx.ext.autodoc` by automatically generating summary tables, similar to `sphinx.ext.autosummary`. It creates a Table of Contents with lists of methods, classes, functions, and attributes for documented modules or classes. The library is actively maintained, with frequent releases to ensure compatibility with the latest Sphinx versions. The current version is 0.2.15.
Warnings
- breaking autodocsumm frequently releases updates to maintain compatibility with new Sphinx versions. Using an `autodocsumm` version that is incompatible with your Sphinx installation can lead to build errors or unexpected documentation output.
- breaking Prior to version 0.2.14, `autodocsumm` might encounter issues with `ObjectMember` related deprecations or removals in newer Sphinx versions, potentially causing documentation build failures.
- gotcha Similar to `sphinx.ext.autodoc`, `autodocsumm` imports the Python modules it documents during the Sphinx build process. If your modules contain executable code with side effects outside of `if __name__ == '__main__'` blocks, this code will be executed when Sphinx builds the documentation.
- gotcha By default, the autosummary tables generated by `autodocsumm` are typically placed at the end of the docstring sections for classes and methods. This might not be the desired visual placement for all users.
Install
-
pip install autodocsumm
Imports
- autodocsumm
extensions = [ 'sphinx.ext.autodoc', 'autodocsumm' ]
Quickstart
# In conf.py
extensions = [
'sphinx.ext.autodoc',
'autodocsumm'
]
# Optional: Make autosummary active by default for all autodoc directives
# autodoc_default_options = {'autosummary': True}
# In your .rst or .md file (e.g., module.rst)
..
.. automodule:: my_package.my_module
:members:
:autosummary:
.. autoclass:: my_package.my_module.MyClass
:members:
:autosummary: