Skip to content

Commit

Permalink
Add summary template
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed May 4, 2024
1 parent 25a7fc7 commit 66f7cd1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ sphinx:
- 'sphinx.ext.autodoc'
- 'sphinx.ext.autosummary'
config:
add_module_names: False
autosummary_generate: True
35 changes: 35 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
.. automethod:: __init__

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

.. autosummary::
:toctree: generated/

{% for item in methods %}
{% if item != "__init__" %}
~{{ name }}.{{ item }}
{% endif %}
{%- endfor %}
{% endif %}
{% endblock %}

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

.. autosummary::
:toctree: generated/

{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
11 changes: 7 additions & 4 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
API Reference
=============
API documentation
=================

.. automodule:: pympipool
:members: generate
.. autosummary::
:toctree: _autosummary
:recursive:

pympipool

0 comments on commit 66f7cd1

Please sign in to comment.