Skip to content

Commit

Permalink
Merge pull request #779 from IanCa/develop
Browse files Browse the repository at this point in the history
Improve toctree in documentation
  • Loading branch information
VisLab authored Oct 23, 2023
2 parents dc9dfcd + 1406760 commit 2b9cf8b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 78 deletions.
34 changes: 0 additions & 34 deletions docs/source/_templates/autosummary/class.rst

This file was deleted.

68 changes: 39 additions & 29 deletions docs/source/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
{{ fullname | escape | underline}}
{{ fullname.split('.')[-1] | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:show-inheritance:
:inherited-members:

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

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

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

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

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
.. autoclass:: {{ module }}.{{ objname }}
:noindex:

.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
{{ module }}.{{ objname }}.{{ item }}
{%- endfor %}

.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
{{ module }}.{{ objname }}.{{ item }}
{%- endfor %}

.. toctree::
:hidden:

{% for item in methods %}
{{ fullname }}#method-{{ item }}
{%- endfor %}
{% for item in attributes %}
{{ fullname }}#attribute-{{ item }}
{%- endfor %}

{% for item in methods %}
.. _method-{{ item }}:

.. automethod:: {{ module }}.{{ objname }}.{{ item }}
{%- endfor %}

{% for item in attributes %}
.. _attribute-{{ item }}:

.. autoattribute:: {{ module }}.{{ objname }}.{{ item }}
{%- endfor %}
29 changes: 18 additions & 11 deletions docs/source/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{ fullname | escape | underline}}
{{ fullname.split('.')[-1] | escape | underline}}

.. currentmodule:: {{ module }}

.. automodule:: {{ fullname }}

Expand All @@ -14,17 +16,22 @@
{% endif %}
{% endblock %}

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

.. autosummary::
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
.. autosummary::
{% for item in functions %}
{{ item }}
{% endfor %}

{% for item in functions %}
.. _{{ item }}:

.. autofunction:: {{ item }}
{% endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api2.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HED API reference (Auto style)
==============================
HED API reference
=================

.. currentmodule:: hed

Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Hierarchical Event Descriptor (HED) Python Tools
Note: this is a work in progress. More information is coming.

.. toctree::
:maxdepth: 4
:maxdepth: 6
:caption: Contents:

introduction.md
user_guide.rst

.. toctree::
:maxdepth: 4
:maxdepth: 6
:caption: HED Python API:

api2.rst
Expand Down

0 comments on commit 2b9cf8b

Please sign in to comment.