From 29755634957933656e0e318a64bd5806b52cbf1c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 4 Jan 2021 16:07:11 +0100 Subject: Enabled missing Sphinx extensions. Fixed role name cls to class. --- doc/_templates/autoapi/module.rst | 143 ++++++++++++++++++++++++++++++++++++++ doc/conf.py | 19 +++-- 2 files changed, 155 insertions(+), 7 deletions(-) create mode 100644 doc/_templates/autoapi/module.rst (limited to 'doc') diff --git a/doc/_templates/autoapi/module.rst b/doc/_templates/autoapi/module.rst new file mode 100644 index 000000000..e359b32af --- /dev/null +++ b/doc/_templates/autoapi/module.rst @@ -0,0 +1,143 @@ +{{ node.name }} +=={{ '=' * node.name|length }}== + +.. automodule:: {{ node.name }} + +{##} +{%- block modules -%} +{%- if subnodes %} + +.. #----------------------------------- +{##} +**Submodules** + +.. toctree:: +{% for item in subnodes %} + {{ item.name }} +{%- endfor %} +{##} +{%- endif -%} +{%- endblock -%} +{##} +.. 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 -%} + + +{%- 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) }} +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} + + +{%- block exceptions -%} +{%- if node.exceptions %} + +.. #----------------------------------- + +{% for item in node.exceptions %} +.. autoexception:: {{ item }} + :members: + :private-members: + :inherited-members: + :undoc-members: +{##} + .. rubric:: Inheritance + .. inheritance-diagram:: {{ item }} +{##} + .. rubric:: Members +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} + + +{%- block classes -%} +{%- if node.classes %} + +.. #----------------------------------- + +{% for item in node.classes %} +.. autoclass:: {{ item }} + :members: + :private-members: + :undoc-members: + :inherited-members: +{##} + .. rubric:: Inheritance + .. inheritance-diagram:: {{ item }} +{##} + .. rubric:: Members +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} + + +{%- block functions -%} +{%- if node.functions %} + +.. #----------------------------------- + +**Functions** + +{% for item in node.functions %} +.. autofunction:: {{ item }} +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} diff --git a/doc/conf.py b/doc/conf.py index 7913baeda..ce6c134e7 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -177,11 +177,16 @@ extensions = [ 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', - 'sphinx.ext.graphviz', +# 'sphinx.ext.graphviz', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', + # BuildTheDocs extensions + 'btd.sphinx.autoprogram', + 'btd.sphinx.graphviz', + 'btd.sphinx.inheritance_diagram', + # Other extensions 'recommonmark', 'exec', @@ -210,12 +215,12 @@ intersphinx_mapping = { # ============================================================================== # see: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration autodoc_member_order = "bysource" # alphabetical, groupwise, bysource -autodoc_default_options = { - "members": True, - 'undoc-members': True, - #'private-members': True, - 'inherited-members': True, -} +# autodoc_default_options = { +# "members": True, +# 'undoc-members': True, +# #'private-members': True, +# 'inherited-members': True, +# } # ============================================================================== -- cgit v1.2.3