From 21267cc68d1c23b29a32719d246c93952a36aacd Mon Sep 17 00:00:00 2001 From: Brian Munkholm Date: Mon, 8 Dec 2025 15:10:26 +0100 Subject: [PATCH 1/3] TOC expand-collapse icons Added icons for collapsable/expandable TOC sections. minor minor --- docs/conf.py | 3 + src/crate/theme/rtd/crate/sidebar.html | 4 + .../rtd/crate/static/css/crateio-rtd.css | 69 ++++++++++- src/crate/theme/rtd/crate/static/js/index.js | 1 + .../theme/rtd/crate/static/js/toc-toggle.js | 108 ++++++++++++++++++ src/crate/theme/rtd/crate/theme.conf | 4 + 6 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 src/crate/theme/rtd/crate/static/js/toc-toggle.js diff --git a/docs/conf.py b/docs/conf.py index f835f8e08..19da2681e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,8 @@ from crate.theme.rtd.conf.theme import * +# Note: TOC toggle icons are enabled by default in the theme. +# To disable: html_theme_options["toc_toggle_icons"] = "false" + # Mimic some bits of the RTD context being propagated to its Sphinx builder. # https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/doc_builder/backends/sphinx.py html_context.update({ diff --git a/src/crate/theme/rtd/crate/sidebar.html b/src/crate/theme/rtd/crate/sidebar.html index ebe24fe3a..2537458fb 100644 --- a/src/crate/theme/rtd/crate/sidebar.html +++ b/src/crate/theme/rtd/crate/sidebar.html @@ -1,4 +1,8 @@ +{% if theme_toc_toggle_icons == 'true' %} +