diff options
| author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-06-24 23:19:22 +0200 | 
|---|---|---|
| committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-12-24 10:03:20 +0100 | 
| commit | e284c9245a01e1709f59dec260cef53f4fb76530 (patch) | |
| tree | 229a3428444897e0deb0422addfc0028a9b0ac79 | |
| parent | 7f37dadcf570795169a24bf75f972949b067401b (diff) | |
| download | ghdl-e284c9245a01e1709f59dec260cef53f4fb76530.tar.gz ghdl-e284c9245a01e1709f59dec260cef53f4fb76530.tar.bz2 ghdl-e284c9245a01e1709f59dec260cef53f4fb76530.zip | |
Improved autoapi template.
(cherry picked from commit 8d85d97998a9f0694889d0ddd579e7d9f247ab3d)
| -rw-r--r-- | doc/_templates/autoapi/module.rst | 106 | 
1 files changed, 76 insertions, 30 deletions
| diff --git a/doc/_templates/autoapi/module.rst b/doc/_templates/autoapi/module.rst index 5c64bbec6..0ad8469a8 100644 --- a/doc/_templates/autoapi/module.rst +++ b/doc/_templates/autoapi/module.rst @@ -25,7 +25,17 @@  {##}  .. currentmodule:: {{ node.name }}  {##} -{%- block functions -%} + +{%- if node.variables %} + +**Variables** + +{% for item, obj in node.variables.items() -%} +- :py:data:`{{ item }}` +  {#{ obj|summary }#} +{% endfor -%} +{%- endif -%} +  {%- if node.functions %}  **Functions** @@ -35,15 +45,19 @@    {{ obj|summary }}  {% endfor -%} +{%- endif -%} -{% for item in node.functions %} -.. autofunction:: {{ item }} -{##} -{%- endfor -%} +{%- if node.exceptions %} + +**Exceptions** + +{% for item, obj in node.exceptions.items() -%} +- :py:exc:`{{ item }}`: +  {{ obj|summary }} + +{% endfor -%}  {%- endif -%} -{%- endblock -%} -{%- block classes -%}  {%- if node.classes %}  **Classes** @@ -53,18 +67,40 @@    {{ obj|summary }}  {% endfor -%} +{%- endif -%} -{% for item in node.classes %} -.. autoclass:: {{ item }} -   :members: -   :private-members: -   :special-members: -   :inherited-members: -   :exclude-members: __weakref__ +{%- block variables -%} +{%- if node.variables %} -   .. rubric:: Inheritance -   .. inheritance-diagram:: {{ item }} -      :parts: 1 +--------------------- + +**Variables** + +{#% for item, obj in node.variables.items() -%} +- :py:data:`{{ item }}` +{% endfor -%#} + +{% for item, obj in node.variables.items() %} +.. autodata:: {{ item }} +   :annotation: + +   .. code-block:: text + +      {{ obj|pprint|indent(6) }} +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} + +{%- block functions -%} +{%- if node.functions %} + +--------------------- + +**Functions** + +{% for item in node.functions %} +.. autofunction:: {{ item }}  {##}  {%- endfor -%}  {%- endif -%} @@ -73,13 +109,15 @@  {%- block exceptions -%}  {%- if node.exceptions %} +--------------------- +  **Exceptions** -{% for item, obj in node.exceptions.items() -%} +{#% for item, obj in node.exceptions.items() -%}  - :py:exc:`{{ item }}`:    {{ obj|summary }} -{% endfor -%} +{% endfor -%#}  {% for item in node.exceptions %}  .. autoexception:: {{ item }} @@ -92,22 +130,30 @@  {%- endif -%}  {%- endblock -%} -{%- block variables -%} -{%- if node.variables %} +{%- block classes -%} +{%- if node.classes %} -**Variables** +--------------------- -{% for item, obj in node.variables.items() -%} -- :py:data:`{{ item }}` -{% endfor -%} +**Classes** -{% for item, obj in node.variables.items() %} -.. autodata:: {{ item }} -   :annotation: +{#% for item, obj in node.classes.items() -%} +- :py:class:`{{ item }}`: +  {{ obj|summary }} -   .. code-block:: text +{% endfor -%#} -      {{ obj|pprint|indent(6) }} +{% for item in node.classes %} +.. autoclass:: {{ item }} +   :members: +   :private-members: +   :special-members: +   :inherited-members: +   :exclude-members: __weakref__ + +   .. rubric:: Inheritance +   .. inheritance-diagram:: {{ item }} +      :parts: 1  {##}  {%- endfor -%}  {%- endif -%} | 
