reducing ToC length

23 views
Skip to first unread message

Steevie

unread,
May 4, 2023, 4:47:39 AM5/4/23
to sphinx...@googlegroups.com
Hi all,

on almost every projects I am working on, after a couple of months, the
table of content becomes quite long and at times it also may result in
strange side-effects (*).

Scenario: I am using RTD theme and I simulated top-level parts by splitting
the toctree in multiple toctress composed of sections, e.g.,

.. toctree::
:maxdepth: 2
:caption: Install:

general
architecture
installation
upgrade

The full toctree is quite long and to reduce its display on the left-hand
side column, I have tried to modify the template to have each top-level
part wrapped in a dropdown, whose title is the title of the part (i.e.,
"Install") and the content the list of the sections (general, architecture,
and so on), but with no luck so far.

My questions therefore are: how do you deal with long ToC? Do you know if
there exists any sphinx-theme or other mechanism that help reducing the
length of the ToC?

I found many projects with extremely long ToC that make somehow difficult
to find the content, so I suppose that there is no answer to my question.

Thanks you in advance for your thoughts!
Stefano

(*) Using RTD theme, if you use tabs from sphinx-design extension, the Toc
"moves" when you click on the tabs. I know I need to report it, but I still
need to identify and frame the problem correctly before submitting


Nico Gulden

unread,
May 4, 2023, 5:15:53 AM5/4/23
to sphinx...@googlegroups.com
Hello Steevie,

I have documents with quite long tables of content, for example
https://docs.software-univention.de/manual/5.0/en/

I use a theme based on Sphinx Book Theme:
https://sphinx-book-theme.readthedocs.io/en/stable/index.html

Give it a try. Maybe it helps.

Best regards,
Nico

Am 04.05.23 um 10:47 schrieb Steevie:
--
Nico Gulden
E-Mail: ngu...@gmx.de
1024D/B2691D50 5415 501F AC07 D04A EB03 D01C 786D 966B B269 1D50

Hardware runs the world, software controls the hardware,
code generates the software, have you coded today?
OpenPGP_signature

Steevie

unread,
May 4, 2023, 5:29:40 AM5/4/23
to sphinx...@googlegroups.com
Hi Nico,

On Thu, 4 May 2023 11:15:24 +0200, Nico Gulden wrote:

> Hello Steevie,
>
> I have documents with quite long tables of content, for example
> https://docs.software-univention.de/manual/5.0/en/
>
> I use a theme based on Sphinx Book Theme:
> https://sphinx-book-theme.readthedocs.io/en/stable/index.html
>
> Give it a try. Maybe it helps.
At a first check, it might be exactly what I was looking for. Thanks for
the suggestion, very appreciated!

Stefano


Reply all
Reply to author
Forward
0 new messages