diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst index 5b3ebf3bd..bc0f0c353 100644 --- a/docs/_templates/autosummary/class.rst +++ b/docs/_templates/autosummary/class.rst @@ -1,6 +1,6 @@ {# - The general principle of this is that we manually document attributes here in - the same file, but give all methods their own page. By default, we document + The general principle of this is that we manually document methods and attributes here in + the same file. By default, we document all methods, including those defined by parent classes. -#} @@ -15,20 +15,17 @@ #} :no-members: :show-inheritance: + :no-inherited-members: + :no-special-members: {# - Methods all get their own separate page, with their names and the first lines - of their docstrings tabulated. The documentation from `__init__` is - automatically included in the standard class documentation, so we don't want - to repeat it. + The documentation from `__init__` is automatically included in the + standard class documentation, so we don't want to repeat it. -#} {% block methods_summary %}{% set wanted_methods = (methods | reject('==', '__init__') | list) %}{% if wanted_methods %} .. rubric:: Methods - .. autosummary:: - :nosignatures: - :toctree: ../stubs/ {% for item in wanted_methods %} - ~{{ name }}.{{ item }} + .. automethod:: {{ name }}.{{ item }} {%- endfor %} {% endif %}{% endblock %} diff --git a/docs/_templates/autosummary/class_no_inherited_members.rst b/docs/_templates/autosummary/class_no_inherited_members.rst index 6cde3cf53..bde3cf030 100644 --- a/docs/_templates/autosummary/class_no_inherited_members.rst +++ b/docs/_templates/autosummary/class_no_inherited_members.rst @@ -14,18 +14,14 @@ #} :no-members: :show-inheritance: -{# - Methods all get their own separate page, with their names and the first lines - of their docstrings tabulated. --#} + :no-inherited-members: + :no-special-members: + {% block methods_summary %}{% set wanted_methods = (methods | reject('in', inherited_members) | reject('==', '__init__') | list) %}{% if wanted_methods %} .. rubric:: Methods Defined Here - .. autosummary:: - :nosignatures: - :toctree: ../stubs/ {% for item in wanted_methods %} - ~{{ name }}.{{ item }} + .. automethod:: {{ name }}.{{ item }} {%- endfor %} {% endif %}{% endblock %}