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 custom documenters in autosummary #6264

Open
epruesse opened this issue Apr 7, 2019 · 4 comments
Open

Allow custom documenters in autosummary #6264

epruesse opened this issue Apr 7, 2019 · 4 comments
Labels
extensions:autosummary type:enhancement enhance or introduce a new feature

Comments

@epruesse
Copy link

epruesse commented Apr 7, 2019

Is your feature request related to a problem? Please describe.

I'd like to have autosummary be able to recognize autodoc documenters other than the built-in ones. E.g. celery tasks. Celery brings it's own documenter [1] in an extension, but the typ of task is not recognized.

[1] http://docs.celeryproject.org/en/latest/_modules/celery/contrib/sphinx.html#TaskDocumenter

Describe the solution you'd like

The code below could be turned into a loop with configurable inputs:

ns['members'] = dir(obj)
ns['functions'], ns['all_functions'] = \
get_members(obj, 'function', imported=imported_members)
ns['classes'], ns['all_classes'] = \
get_members(obj, 'class', imported=imported_members)
ns['exceptions'], ns['all_exceptions'] = \
get_members(obj, 'exception', imported=imported_members)

The list could be automatically, or manually, extended with further documenters, via conf.py or from other extensions.

Describe alternatives you've considered

  • configure via conf.py
  • configure from other extension
  • determine directly from registered documenters

(The last would be great - although a question is how to know what is available when adapting the jinja template)

@epruesse epruesse added the type:enhancement enhance or introduce a new feature label Apr 7, 2019
@tk0miya tk0miya added this to the some future version milestone Apr 7, 2019
@epruesse
Copy link
Author

epruesse commented Apr 8, 2019

@tk0miya Would it be worth coming up with a PR for this?

@tk0miya
Copy link
Member

tk0miya commented May 25, 2019

@epruesse Sorry for late response. Yes, please!

Note: autosummary already knows registered documenters. Simply it does not use them to generate template variables.

@mansenfranzen
Copy link

@epruesse @tk0miya I would like to make some progress on this issue. I could provide a PR myself but don't want to duplicate efforts if there is an existing PR already.

@epruesse epruesse changed the title Allow custom documentes in autosummary Allow custom documents in autosummary Aug 30, 2021
@epruesse epruesse changed the title Allow custom documents in autosummary Allow custom documenters in autosummary Aug 30, 2021
@mansenfranzen
Copy link

@tk0miya @epruesse Just a friendly reminder if you could provide a short feedback if there has been any PR or approach already for the current issue (see my previous response).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions:autosummary type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

3 participants