Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow autosummary to create pages for classes, functions, etc #11488

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ZedThree
Copy link

Subject: Allow autosummary to create pages for classes, functions, and so on

Feature or Bugfix

  • Feature

Purpose

As detailed in #7912 and linked issues, autosummary is very useful and with a small tweak is incredibly powerful for generating complete API docs for a project.

The solution here is perhaps a little hacky, but it builds on the templates proposed in #7912, with an escape-hatch for projects where this solutions causes more issues. The new option autosummary_recurse_members (strawperson name) basically just controls whether :toctree: is set in the template or not:

   .. autosummary::
   {%- if recurse_members %}
      :toctree:
   {% endif %}

This new option defaults to True so that users get this out of the box -- but this was just my preference.

In the class template, the :inherited-members: setting is also guarded to respect autodoc_inherit_docstrings. I'm not sure if the I've implemented this in the correct way, but it does seem to work.

Relates

@ZedThree ZedThree force-pushed the autosummary-recurse-members branch from 2fd19d2 to a67b49b Compare July 26, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant