From 7f37dadcf570795169a24bf75f972949b067401b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 22 Jun 2022 09:00:42 +0200 Subject: Updated autoapi template. (cherry picked from commit 4977150c62f61abd9740f6b0386dc2340b13dd07) --- doc/_templates/autoapi/module.rst | 129 +++++++++++++++----------------------- 1 file changed, 50 insertions(+), 79 deletions(-) (limited to 'doc') diff --git a/doc/_templates/autoapi/module.rst b/doc/_templates/autoapi/module.rst index e359b32af..5c64bbec6 100644 --- a/doc/_templates/autoapi/module.rst +++ b/doc/_templates/autoapi/module.rst @@ -1,4 +1,9 @@ -{{ node.name }} +.. # Template modified by Patrick Lehmann + * removed automodule on top, because private members are activated for autodoc (no doubled documentation). + * Made sections like 'submodules' bold text, but no headlines to reduce number of ToC levels. + +=={{ '=' * node.name|length }}== +``{{ node.name }}`` =={{ '=' * node.name|length }}== .. automodule:: {{ node.name }} @@ -7,10 +12,9 @@ {%- block modules -%} {%- if subnodes %} -.. #----------------------------------- -{##} **Submodules** + .. toctree:: {% for item in subnodes %} {{ item.name }} @@ -21,122 +25,89 @@ {##} .. currentmodule:: {{ node.name }} {##} - -.. #----------------------------------- -{##} -{%- if node.variables %} -**Variables** -{##} -{% for item, obj in node.variables.items() -%} -- :py:data:`{{ item }}` -{% endfor -%} -{%- endif -%} - - -{%- if node.exceptions %} -{##} -**Exceptions** -{##} -{% for item, obj in node.exceptions.items() -%} -- :py:exc:`{{ item }}`: - {{ obj|summary }} - -{% endfor -%} -{%- endif -%} - - -{%- if node.classes %} -{##} -**Classes** -{##} -{% for item, obj in node.classes.items() -%} -- :py:class:`{{ item }}`: - {{ obj|summary }} - -{% endfor -%} -{%- endif -%} - - +{%- block functions -%} {%- if node.functions %} -{##} + **Functions** -{##} + {% for item, obj in node.functions.items() -%} - :py:func:`{{ item }}`: {{ obj|summary }} {% endfor -%} -{%- endif -%} - -{%- block variables -%} -{%- if node.variables %} -{% for item, obj in node.variables.items() %} -.. autodata:: {{ item }} - :annotation: - - .. code-block:: guess - - {{ obj|pprint|indent(6) }} +{% for item in node.functions %} +.. autofunction:: {{ item }} {##} {%- endfor -%} {%- endif -%} {%- endblock -%} +{%- block classes -%} +{%- if node.classes %} -{%- block exceptions -%} -{%- if node.exceptions %} +**Classes** + +{% for item, obj in node.classes.items() -%} +- :py:class:`{{ item }}`: + {{ obj|summary }} -.. #----------------------------------- +{% endfor -%} -{% for item in node.exceptions %} -.. autoexception:: {{ item }} +{% for item in node.classes %} +.. autoclass:: {{ item }} :members: :private-members: + :special-members: :inherited-members: - :undoc-members: -{##} + :exclude-members: __weakref__ + .. rubric:: Inheritance .. inheritance-diagram:: {{ item }} -{##} - .. rubric:: Members + :parts: 1 {##} {%- endfor -%} {%- endif -%} {%- endblock -%} +{%- block exceptions -%} +{%- if node.exceptions %} -{%- block classes -%} -{%- if node.classes %} +**Exceptions** -.. #----------------------------------- +{% for item, obj in node.exceptions.items() -%} +- :py:exc:`{{ item }}`: + {{ obj|summary }} + +{% endfor -%} + +{% for item in node.exceptions %} +.. autoexception:: {{ item }} -{% for item in node.classes %} -.. autoclass:: {{ item }} - :members: - :private-members: - :undoc-members: - :inherited-members: -{##} .. rubric:: Inheritance .. inheritance-diagram:: {{ item }} -{##} - .. rubric:: Members + :parts: 1 {##} {%- endfor -%} {%- endif -%} {%- endblock -%} +{%- block variables -%} +{%- if node.variables %} -{%- block functions -%} -{%- if node.functions %} +**Variables** -.. #----------------------------------- +{% for item, obj in node.variables.items() -%} +- :py:data:`{{ item }}` +{% endfor -%} -**Functions** +{% for item, obj in node.variables.items() %} +.. autodata:: {{ item }} + :annotation: -{% for item in node.functions %} -.. autofunction:: {{ item }} + .. code-block:: text + + {{ obj|pprint|indent(6) }} {##} {%- endfor -%} {%- endif -%} -- cgit v1.2.3