When using the Attributes
section in a class docstring, E.g.
class Hello:
"""Hello World!
Attributes
----------
thing: int
The thing for Hello.
"""
Also applies to Google style docstrings.
No ToC of those attributes are generated.
Properties (@property
) in the class are properly added to the ToC.
This is also an issue on the insiders build where the use of summaries doesn't include these attributes in it's summary. And without the show_docstring_attributes: false
option, the Attributes
section is actually generated twice; One with all the properties already included in the ToC and another with all the attributes in the docstring (but they can't be referenced).
Adding doctstring below the attribute works, but this is not ideal, especially when dealing with large documentation or classes with a large amount of attributes or when any ordering of these attributes or logic is needed to be done in __init__
.
No traceback.
The Attributes
section from the class docstring displays and add attributes to the toc appropriately and doesn't generate a secondary summary on insiders builds.
mkdocs
v1.5.3mkdocstrings
v0.24.0mkdocstrings-python
v1.8.0.1.6.1.dev4+g157224dgriffe
v0.40.1.1.0.0Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too