Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 26 additions & 30 deletions docs/source/_templates/api_reference_class_template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@

.. autoclass:: {{ objname }}

{% block methods %}
{%- set attributes_non_inherited = [] %}
{%- set attributes_inherited = [] %}

{%- for item in attributes %}
{%- if item not in inherited_members %}
{{- attributes_non_inherited.append(item) or '' }}
{%- else %}
{{- attributes_inherited.append(item) or '' }}
{%- endif %}
{%- endfor %}


{%- set methods_non_inherited = [] %}
{%- set methods_inherited = [] %}
Expand All @@ -38,56 +48,42 @@
{%- endif %}
{%- endfor %}

{% if methods_non_inherited %}
.. rubric:: {{ _('Methods') }}

{% if attributes_non_inherited %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in methods_non_inherited %}
{% for item in attributes_non_inherited %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}

{% if methods_inherited %}
.. rubric:: {{ _('Inherited Methods') }}

{% if methods_non_inherited %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods_inherited %}
{% for item in methods_non_inherited %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}

{% endblock %}


{% block attributes %}

{%- set attributes_non_inherited = [] %}
{%- set attributes_inherited = [] %}

{%- for item in attributes %}
{%- if item not in inherited_members %}
{{- attributes_non_inherited.append(item) or '' }}
{%- else %}
{{- attributes_inherited.append(item) or '' }}
{%- endif %}
{%- endfor %}

{% if attributes_non_inherited %}
.. rubric:: {{ _('Attributes') }}
{% if attributes_inherited %}
.. rubric:: {{ _('Inherited Attributes') }}

.. autosummary::
{% for item in attributes_non_inherited %}
{% for item in attributes_inherited %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}

{% if attributes_inherited %}
.. rubric:: {{ _('Inherited Attributes') }}

{% if methods_inherited %}
.. rubric:: {{ _('Inherited Methods') }}

.. autosummary::
{% for item in attributes_inherited %}
{% for item in methods_inherited %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}

{% endblock %}