Show a list of all open functions in the sidebar for Sphinx documentation

How can I add a bulleted list of "public" features to the sidebar of a project registered with Sphinx?

For example, suppose I have an api.py module with the following functions:

  • function1 ()
  • function2 ()
  • function3 ()

I want to have a bulleted list of links to functions1, function2 and function3 in the sidebar of the documentation. These links will link to a page for this feature, which is documented using :automodule: api. Thus, each sidebar link will simply reference autodoc'ed information for this function.

I tried using the built-in extension autosummaryand extension fulltoc, but I could not get them to do this with a random set of configuration options that I tried.

I think this might require the creation of a custom sidebar.html template. However, how do I get a list of all the module functions in a Jinja template?

Honestly, I would not mind just hard coding a custom template, where I had to manually list the function and links, but I can’t figure out how to set information hreffor each element directly to this function.

+3
source share

All Articles