'Get autosummary to produce a flat representation
If I have a file foo.baz.py
:
from foo.bar.baz import Quux, Quuux
__all__ = ['Quux', 'Quuux']
I'd like to document the api as follows:
Baz
===
.. currentmodule:: foo.baz
.. autosummary::
:toctree: generated/
:nosignatures:
Quux
Quuux
This gives me an autosummary table with Quux
and Quuux
, and links to pages containing their full documentation. However, it requires me to explicitly list Quux
and Quuux
, so whenever I add a class, I have to manually add it to the documentation.
Instead, I'd rather like to do something like this, and have it automatically generate a table based on __all__
, to get exactly the same output as above:
Baz
===
.. currentmodule:: foo
.. autosummary::
:toctree: generated/
:nosignatures:
baz
But this doesn't work, it produces a table with a single entry, the module baz
, leading to a page with all its contents as well as a summary table.
Is there a way to achieve this? In case it's relevant, I'm using numpydoc
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|