pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

Expose the genindex index

Open mattip opened this issue 4 years ago • 5 comments

Over at NumPy someone asked what happened to the index page (genindex.html in sphinx-speak) numpy/numpy#18309. Is there a "recommended way" to expose it via the theme? A quick browse on the readthedocs site for the theme, and from there bokeh's and panda's documentation did not provide any enlightenment.

mattip avatar Feb 03 '21 07:02 mattip

This is indeed currently not exposed in this theme in the actual layout (you are of course free to put a link to it on any page, like the default sphinx landing page does).

Generally speaking, if you want to add this, you can do that with a custom template layout.html extending the theme's layout. But if there is demand for this, we should see if we can add this (optionally) to the theme itself.

I think the main question is: where would we want to put this?
In the right sidebar? Or you in the footer? (this would be relatively easy to extend as a downstream user)

For example, also the readthedocs theme doesn't seem to include a direct link in its layout, as far as I can see (eg http://xarray.pydata.org/en/stable/index.html), so that doesn't give inspiration.

jorisvandenbossche avatar Feb 03 '21 08:02 jorisvandenbossche

If you are looking for inspiration:

I've created an indices.html template: https://github.com/mgeier/insipid-sphinx-theme/blob/master/src/insipid_sphinx_theme/insipid/indices.html ... which is part of my theme's sidebar by default, but can of course be overwritten by html_sidebars.

For an example, see https://insipid-sphinx-theme.readthedocs.io/configuration.html#confval-html_sidebars

mgeier avatar Feb 07 '21 20:02 mgeier

@mgeier I couldn't find a link to genindex in the example, or was that a link to the configuration variable that could theoritically be used?

mattip avatar Feb 08 '21 07:02 mattip

Yeah, sorry, I should have explained where it is actually located ...

It's part of the sidebar (which you can show by clicking the hamburger menu), just below the table of contents. The official English name seems to be "General Index" but it is translatable.

The default sidebar content is defined in https://github.com/mgeier/insipid-sphinx-theme/blob/4896cacdf070afba6240eb428d80933882dbc0f0/src/insipid_sphinx_theme/insipid/theme.conf#L4.

mgeier avatar Feb 08 '21 09:02 mgeier

Thanks, I didn't look inside the hamburger menu. That seems like a reasonable place, so for our docs it would be at the bottom of the left navbar.

mattip avatar Feb 08 '21 09:02 mattip