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.
I want to use the autosummary_generate to automatically generate rst files for a large project. Some of my modules define data constants. I'm using a customized module.rst template to get the output just the way I want, but there is no way to include the module data in the output.
Describe the solution you'd like
autosummary_generate should support module data just as it currently support module classes/exceptions/functions, i.e. by providing a "data" variable containing a list of the data items defined in this module, which could be used with autodata or similar. This would need to be added in the generate_autosummary_content function of generate.py
Maybe the default autosummary module.rst template should display data fields (just like automodule does), but that's less pressing - the most important thing is to add it to the templating so that at least people can add it themselves if needed.
Describe alternatives you've considered
I tried using "members" as a workaround (since I figured any member that's not in functions/classes/exceptions must be data) however annoyingly/surprisingly members is implemented using dir(module) rather than the get_members() function all the others use, so bypasses the normal logic for deciding about private/non-private and direct members vs imported so includes far too much junk to be useful. https://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html
I can't see any extension hooks that would enable an enduser of sphinx to add this capability without forking/changing the autosummary extension itself
Additional context
(While we're at it, a list of submodules would be really nice too)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to use the autosummary_generate to automatically generate rst files for a large project. Some of my modules define data constants. I'm using a customized module.rst template to get the output just the way I want, but there is no way to include the module data in the output.
Describe the solution you'd like
autosummary_generate should support module data just as it currently support module classes/exceptions/functions, i.e. by providing a "data" variable containing a list of the data items defined in this module, which could be used with autodata or similar. This would need to be added in the generate_autosummary_content function of generate.py
Maybe the default autosummary module.rst template should display data fields (just like automodule does), but that's less pressing - the most important thing is to add it to the templating so that at least people can add it themselves if needed.
Describe alternatives you've considered
I tried using "members" as a workaround (since I figured any member that's not in functions/classes/exceptions must be data) however annoyingly/surprisingly members is implemented using dir(module) rather than the get_members() function all the others use, so bypasses the normal logic for deciding about private/non-private and direct members vs imported so includes far too much junk to be useful.
https://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html
I can't see any extension hooks that would enable an enduser of sphinx to add this capability without forking/changing the autosummary extension itself
Additional context
(While we're at it, a list of submodules would be really nice too)
The text was updated successfully, but these errors were encountered: