Linux Documentation
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Documentation: html: show sections in the sidebar
@ 2026-08-04 15:59 Antonin Godard
  2026-08-04 15:59 ` [PATCH v2 1/2] " Antonin Godard
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Antonin Godard @ 2026-08-04 15:59 UTC (permalink / raw)
  To: Jonathan Corbet, Shuah Khan
  Cc: Thomas Petazzoni, linux-doc, linux-kernel, Antonin Godard,
	Randy Dunlap

The current sidebar in the HTML version of the documentation does not
display the section titles because the toctree directives in the
top-level index.rst document do not contain ":caption:" properties.
Replacing the current section titles by ":caption:" properties would not
allow having text between those and the table of contents.

To workaround this issue, add the ":caption:" properties in the toctree
calls which makes them show up in the sidebar, but hide them from the
index page with a custom CSS addition.

Additionally, make the section titles in the sidebar bold to make them
stand-out.

This makes the overall structure of the documentation clearer from the
sidebar directly.

PS: This is how I've implemented this in the Yocto Project
documentation[1] where I faced the same issue. See also the index.rst
file[2] (which was by the way inspired by the kernel's own index.rst)
and CSS addition[3].

[1]: https://docs.yoctoproject.org/dev/
[2]: https://git.yoctoproject.org/yocto-docs/tree/documentation/index.rst
[3]: https://git.yoctoproject.org/yocto-docs/tree/documentation/sphinx-static/theme_overrides.css#n106

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Changes in v2:
- Apply RB and TB from Randy on patch 1/2.
- Remove whitespace before section title and first subsection.
- Link to v1: https://patch.msgid.link/20260803-show-sections-in-sidebar-v1-0-b4fdc847525d@bootlin.com

---
Antonin Godard (2):
      Documentation: html: show sections in the sidebar
      Documentation: html: adjust sidebar section titles styling

 Documentation/index.rst                |  8 ++++++++
 Documentation/sphinx-static/custom.css | 12 ++++++++++++
 2 files changed, 20 insertions(+)
---
base-commit: 075b74841bd0065a3bda3440873c747938e69b68
change-id: 20260723-show-sections-in-sidebar-b7f9aadf540e


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-06 13:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 15:59 [PATCH v2 0/2] Documentation: html: show sections in the sidebar Antonin Godard
2026-08-04 15:59 ` [PATCH v2 1/2] " Antonin Godard
2026-08-04 15:59 ` [PATCH v2 2/2] Documentation: html: adjust sidebar section titles styling Antonin Godard
2026-08-04 16:49   ` Randy Dunlap
2026-08-05 19:41 ` [PATCH v2 0/2] Documentation: html: show sections in the sidebar Jonathan Corbet
2026-08-06  8:57   ` Antonin Godard
2026-08-06 13:10     ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox