Skip to content

Commit

Permalink
Merge pull request #976 from arnaucasau/no-method-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
zlatko-minev authored Nov 9, 2023
2 parents 74629bc + 1a3f9af commit d4e9c1e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 23 deletions.
33 changes: 10 additions & 23 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,25 @@
:no-inherited-members:
:no-special-members:

{% block attributes_summary %}
{% block attributes_summary %}
{% if attributes %}

.. rubric:: Attributes

.. autosummary::
:toctree: ../stubs/
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
.. autoattribute:: {{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}
{% endblock %}

{% block methods_summary %}
{% block methods_summary %}
{% if methods %}

.. rubric:: Methods

.. autosummary::
:toctree: ../stubs/
{% for item in all_methods %}
{%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% for item in inherited_members %}
{%- if item in ['__call__', '__mul__', '__getitem__', '__len__'] %}
{{ name }}.{{ item }}
.. automethod:: {{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}

{% endif %}
{% endblock %}
{% endblock %}
40 changes: 40 additions & 0 deletions docs/_templates/autosummary/class_no_inherited_members.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{# This is identical to class.rst, except for the filtering of the inherited_members. -#}

{% if referencefile %}
.. include:: {{ referencefile }}
{% endif %}

{{ objname }}
{{ underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:no-members:
:no-inherited-members:
:no-special-members:

{% block attributes_summary %}
{% if attributes %}
.. rubric:: Attributes
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
.. autoattribute:: {{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}

{% block methods_summary %}
{% if methods %}
.. rubric:: Methods
{% for item in all_methods %}
{%- if item not in inherited_members %}
{%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %}
.. automethod:: {{ name }}.{{ item }}
{%- endif -%}
{%- endif -%}
{%- endfor %}

{% endif %}
{% endblock %}

0 comments on commit d4e9c1e

Please sign in to comment.