Skip to content

Commit

Permalink
housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
menckend committed Oct 23, 2024
1 parent 625f2a6 commit 44e478f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 54 deletions.
4 changes: 2 additions & 2 deletions docs/_templates/autoapi/python/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Classes

.. autoapisummary::

{% for class in visible_classes %}
{{ class.id }}
{% for klass in visible_classes %}
{{ klass.id }}
{% endfor %}


Expand Down
71 changes: 19 additions & 52 deletions docs/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -1,66 +1,33 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}
.. currentmodule:: {{ module }}

{% block attributes %}
{% if attributes %}
.. rubric:: Module attributes

.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
.. autoclass:: {{ objname }}
:members:
:show-inheritance:
:inherited-members:
:special-members: __call__, __add__, __mul__

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}
{% block methods %}
{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:toctree:
:nosignatures:
{% for item in functions %}
{{ item }}
{% for item in methods %}
{%- if not item.startswith('_') %}
~{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:
:template: custom-class-template.rst
:nosignatures:
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}
{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. autosummary::
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% endblock %}

0 comments on commit 44e478f

Please sign in to comment.