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

Show module functions and/or class methods in sidebar (autodoc) #842

Closed
pawamoy opened this issue Oct 21, 2019 · 5 comments
Closed

Show module functions and/or class methods in sidebar (autodoc) #842

pawamoy opened this issue Oct 21, 2019 · 5 comments

Comments

@pawamoy
Copy link

pawamoy commented Oct 21, 2019

(Not using bug template since it's more a question / feature request)

I'm not sure this is related to sphinx_rtd_theme or sphinx itself. Asking anyway.

I use sphinx.ext.autodoc features to add documentation for modules (and their members) and classes (and their members). I would like to show these members in the sidebar. Is this possible with the current theme, or would it require modification?

I also posted the question on stackoverflow if you want more details: https://stackoverflow.com/questions/58486590/sphinx-sidebar-include-modules-functions-and-class-methods

@agjohnson
Copy link
Collaborator

This would be more of a Sphinx question. You can author your docs to use explicit headings, but if you want per-method/function granularity on headings/toc entries, you'd probably have to explicitly call autodoc on each function/method/etc and provide a heading manually.

I don't believe there is an autodoc option for outputting the domain items (reST of python/etc functions/methods) with headings included. I'd look into Sphinx options and the autodoc & friends directives.

@pawamoy
Copy link
Author

pawamoy commented Oct 21, 2019

So the sidebar will only pick headings, right? Because functions and methods do have an anchor. Would it be possible to customize the rtd theme on my end to make it add links to these anchors?

@agjohnson
Copy link
Collaborator

Correct, but that is a Sphinx thing, not something particular with our theme. Immediately, I don't know of a why to do what you're looking for. There are some creative options that could involve extending the autodoc Sphinx roles/directives for the domain you're using, but you'll need to dive into Sphinx internals to figure that one out.

@AtmaMani
Copy link

AtmaMani commented May 1, 2020

@pawamoy I have the same requirement, did you find a solution for this with Sphinx?

@pawamoy
Copy link
Author

pawamoy commented May 2, 2020

@AtmaMani not with Sphinx, no 😕

I switched to MkDocs and wrote for it an autodoc plugin which has this feature: mkdocstrings, and I'm very happy with it 🙂

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

No branches or pull requests

3 participants