Sphinx extension to support docstrings in Numpy format
Render NumPy-style class docstrings to reStructuredText while letting callers toggle which class members appear and how attributes are formatted.
BaseWidget with a NumPy-style docstring containing an Attributes section for base_attr and a method ping.FancyWidget with its own Attributes entry name and method do, inheriting from BaseWidget.include_members=False emits only the class summary/parameter section; no attribute or method listing appears in the output. @testinclude_members=True and include_inherited=False, the output lists only FancyWidget's own attribute and method names. @testinclude_members=True and include_inherited=True, the output also lists inherited attribute and method names from BaseWidget. @testattributes_as_params=True, attributes render as parameter-style entries (name followed by type and description) rather than a raw bulleted list. @testattributes_as_params=False, attributes render in the standard attributes section format instead of parameter-style entries. @testmembers_toctree=True, the rendered output includes a members table-of-contents that links to each listed member. @test@generates
from typing import Type
def render_class_doc(
obj: Type,
include_members: bool = True,
include_inherited: bool = False,
attributes_as_params: bool = True,
members_toctree: bool = False,
) -> str:
"""
Render the docstring for a class to reStructuredText, honoring toggles for
class member inclusion, inherited members, attribute formatting style, and
per-member table of contents generation.
"""Use the docstring rendering extension to build the class documentation with configurable member visibility and attribute formatting. @satisfied-by
tessl i tessl/pypi-numpydoc@1.9.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9