You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We are using sphinx.ext.autosummary with _templates to create new files for each class, attribute, function.
This works perfectly for the above mentioned, where the template file contains (e.g. just for classes):
{% if classes %}
.. automodule:: {{ fullname }}
.. currentmodule:: {{ fullname }}
.. rubric:: Classes
.. autosummary::
:toctree::nosignatures:
{% for class in classes %}
{{ class }}
{% endfor %}
{% endif %}
``
Note that we are setting with ``.. currentmodule:: {{ fullname }}`` the correct path to the current file and then document each class with: ``{% for class in classes %}``. This works, because ``classes`` returns the class names without prefix (the path contained in ``fullname``).
For modules, on the other hand, the approach doesn't work:
```rst{% if modules %}.. automodule:: {{ fullname }}.. currentmodule:: {{ fullname }}.. autosummary:: :toctree: :recursive: :template: module.rst {% for module in modules %} {{ module }} {% endfor %}{% endif %}
The problem is here that modules returns a list of modules with the full path.
Describe the solution you'd like
Have modules return only the module name without prefix (full path)
Additional context
We use Sphinx to document our toolbox do-mpc
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
We are using
sphinx.ext.autosummary
with_templates
to create new files for each class, attribute, function.This works perfectly for the above mentioned, where the template file contains (e.g. just for
classes
):The problem is here that
modules
returns a list of modules with the full path.Describe the solution you'd like
Have
modules
return only the module name without prefix (full path)Additional context
We use Sphinx to document our toolbox do-mpc
The text was updated successfully, but these errors were encountered: