diff --git a/docs/api.rst b/docs/api.rst index a85c3256..66f4970f 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -3,6 +3,7 @@ API documentation .. autosummary:: :toctree: _autosummary + :template: templates/custom-module-template.rst :recursive: pympipool \ No newline at end of file diff --git a/docs/_templates/autosummary/class.rst b/docs/templates/custom-class-template.rst similarity index 78% rename from docs/_templates/autosummary/class.rst rename to docs/templates/custom-class-template.rst index a82f4e47..16ebb2f3 100644 --- a/docs/_templates/autosummary/class.rst +++ b/docs/templates/custom-class-template.rst @@ -3,6 +3,9 @@ .. currentmodule:: {{ module }} .. autoclass:: {{ objname }} + :members: + :show-inheritance: + :inherited-members: {% block methods %} .. automethod:: __init__ @@ -11,12 +14,8 @@ .. rubric:: {{ _('Methods') }} .. autosummary:: - :toctree: generated/ - {% for item in methods %} - {% if item != "__init__" %} - ~{{ name }}.{{ item }} - {% endif %} + ~{{ name }}.{{ item }} {%- endfor %} {% endif %} {% endblock %} @@ -26,8 +25,6 @@ .. rubric:: {{ _('Attributes') }} .. autosummary:: - :toctree: generated/ - {% for item in attributes %} ~{{ name }}.{{ item }} {%- endfor %} diff --git a/docs/templates/custom-module-template.rst b/docs/templates/custom-module-template.rst new file mode 100644 index 00000000..74078355 --- /dev/null +++ b/docs/templates/custom-module-template.rst @@ -0,0 +1,66 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + .. rubric:: Module Attributes + + .. autosummary:: + :toctree: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + +{% block modules %} +{% if modules %} +.. rubric:: Modules + +.. autosummary:: + :toctree: + :template: custom-module-template.rst + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{% endblock %} \ No newline at end of file