Skip to content
Open
Show file tree
Hide file tree
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
74 changes: 74 additions & 0 deletions docs/_templates/autosummary_class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{ objname | underline}}

.. currentmodule:: {{ module }}

{{ 'Class' }}
{{ '-----' }}

.. autoclass:: {{ objname }}

{# Aesthetic section: drop if maintenance becomes a future difficulty #}
{% set counter_methods = namespace(count = 0) %}
{% for item in methods %}
{%- if not item.startswith('_') %}
{% set counter_methods.count = counter_methods.count + 1 %}
{%- endif -%}
{%- endfor %}

{% if attributes or counter_methods.count > 0 %}
{{- 'Class Members: Summary\n' }}
{{- '----------------------'}}
{% endif %}

{% block attributes %}
{% if attributes %}
{{- 'Properties\n' }}
{{- '~~~~~~~~~~\n' }}
{{- '.. autosummary::' }}
{% for item in attributes %}
~{{ name }}.{{ item }}
{% endfor %}
{% endif %}
{% endblock %}

{% block methods %}
{% if counter_methods.count > 0 %}
{{- 'Methods\n' }}
{{- '~~~~~~~\n' }}
{{- '.. autosummary::' }}
{{- ' :nosignatures:'}}
{% for item in methods %}
{%- if not item.startswith('_') %}
~{{ name }}.{{ item }}
{%- endif -%}
{% endfor %}
{% endif %}
{% endblock %}

{% if attributes or counter_methods.count > 0 %}
{{- 'Class Members: Descriptions\n' }}
{{- '---------------------------' }}
{% endif %}


{% block attributes2 %}
{% if attributes %}
{{- 'Properties\n' }}
{{- '~~~~~~~~~~\n' }}
{% for item in attributes %}
.. autoattribute:: {{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block methods2 %}
{% if counter_methods.count > 0 %}
{{- 'Methods\n' }}
{{- '~~~~~~~\n' }}
{% for item in methods %}
{%- if not item.startswith('_') %}
.. automethod:: {{ name }}.{{ item }}
{%- endif -%}
{% endfor %}
{% endif %}
{% endblock %}
33 changes: 33 additions & 0 deletions docs/_templates/autosummary_module_functions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{{ 'Functions: Summary' }}
{{ '------------------' }}

{% block functions %}
{# To prevent template error, but template should not be applied to such modules #}
{% if functions %}
{{- '.. autosummary::' }}
{%- for item in functions %}
{%- if not item.startswith('_') %}
{{ item }}
{%- endif %}
{%- endfor %}
{% endif %}
{% endblock %}


{{ 'Functions: Descriptions'}}
{{ '-----------------------' }}

{% block functions2 %}
{# To prevent template error, but template should not be applied to such modules #}
{% if functions %}
{%- for item in functions %}
{%- if not item.startswith('_') %}
.. autofunction:: {{ item }}
{%- endif %}
{%- endfor %}
{% endif %}
{% endblock %}
Loading