evildmp / vanilla-sphinx-test

2 stars 5 forks source link

Page title should not be displayed in local ToC #11

Open ru-fu opened 3 years ago

ru-fu commented 3 years ago

The page title should not be displayed in the local table of contents (contents on the right). It just adds another level.

Example in this project

For example: image

The menu on the right should only have Go, Kernel requirements, ... I know that I'm on the Requirements page. ;)

pmahnke commented 2 years ago

This is something we fix in the sphinx config

evildmp commented 2 years ago

https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents

anthonydillon commented 2 years ago

Estimate: 3

ru-fu commented 2 years ago

The Furo theme fixes this by just hiding it in CSS. This CSS does the trick:

aside.p-side-navigation--raw-html>ul>li:first-child>a {
    display: none;
}
ru-fu commented 2 years ago

Actually, this will leave a lonely "Contents" for the ToC on pages where there are no subheadings. This should probably be fixed in Python (for example, in the way that Furo uses).

As a workaround, we can just hide it for all pages in CSS:

aside.p-side-navigation--raw-html h3 {
    display: none;
}

It should also be possible to just add :hide-toc: to those pages, but I can't get that to work right now.