From 44e478f93db9984d779bbc0bc34a44455a6ab499 Mon Sep 17 00:00:00 2001 From: Mencken Davidson <76002183+menckend@users.noreply.github.com> Date: Wed, 23 Oct 2024 00:46:35 -0400 Subject: [PATCH] housekeeping --- docs/_templates/autoapi/python/class.rst | 4 +- docs/_templates/custom-class-template.rst | 71 ++++++----------------- 2 files changed, 21 insertions(+), 54 deletions(-) diff --git a/docs/_templates/autoapi/python/class.rst b/docs/_templates/autoapi/python/class.rst index 6f5242e..379f83a 100644 --- a/docs/_templates/autoapi/python/class.rst +++ b/docs/_templates/autoapi/python/class.rst @@ -81,8 +81,8 @@ Classes .. autoapisummary:: - {% for class in visible_classes %} - {{ class.id }} + {% for klass in visible_classes %} + {{ klass.id }} {% endfor %} diff --git a/docs/_templates/custom-class-template.rst b/docs/_templates/custom-class-template.rst index dd90e32..d248858 100644 --- a/docs/_templates/custom-class-template.rst +++ b/docs/_templates/custom-class-template.rst @@ -1,66 +1,33 @@ {{ fullname | escape | underline}} -.. automodule:: {{ fullname }} +.. currentmodule:: {{ module }} - {% block attributes %} - {% if attributes %} - .. rubric:: Module attributes - - .. autosummary:: - :toctree: - {% for item in attributes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} +.. autoclass:: {{ objname }} + :members: + :show-inheritance: + :inherited-members: + :special-members: __call__, __add__, __mul__ - {% block functions %} - {% if functions %} - .. rubric:: {{ _('Functions') }} + {% block methods %} + {% if methods %} + .. rubric:: {{ _('Methods') }} .. autosummary:: - :toctree: - :nosignatures: - {% for item in functions %} - {{ item }} + {% for item in methods %} + {%- if not item.startswith('_') %} + ~{{ name }}.{{ item }} + {%- endif -%} {%- endfor %} {% endif %} {% endblock %} - {% block classes %} - {% if classes %} - .. rubric:: {{ _('Classes') }} - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - {% for item in classes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block exceptions %} - {% if exceptions %} - .. rubric:: {{ _('Exceptions') }} + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} .. autosummary:: - :toctree: - {% for item in exceptions %} - {{ item }} + {% for item in attributes %} + ~{{ name }}.{{ item }} {%- endfor %} {% endif %} - {% endblock %} - -{% block modules %} -{% if modules %} -.. autosummary:: - :toctree: - :template: custom-module-template.rst - :recursive: -{% for item in modules %} - {{ item }} -{%- endfor %} -{% endif %} -{% endblock %} \ No newline at end of file + {% endblock %} \ No newline at end of file