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