summaryrefslogtreecommitdiffstats
path: root/Documentation/sphinx
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2023-01-20 01:03:05 +0100
committerJonathan Corbet <corbet@lwn.net>2023-02-08 21:28:27 +0100
commitc404f5d4f0993e9d75a4de5a91280e9cb2419281 (patch)
tree2f68fd709a0c3202250e9eadf29f46e55b7d4e8e /Documentation/sphinx
parentDocumentation: KVM: Update AMD memory encryption link (diff)
downloadlinux-c404f5d4f0993e9d75a4de5a91280e9cb2419281.tar.xz
linux-c404f5d4f0993e9d75a4de5a91280e9cb2419281.zip
docs: Add more information to the HTML sidebar
Add a new sidebar template that creates a more RTD-like "fisheye" view of the current place in the document hierarchy. It is far from ideal, but some readers may find it better for navigating through the documentation as a whole. Add some CSS trickery as well to make the table of contents less intrusive when viewing the pages on a small screen. Reviewed-by: Akira Yokosawa <akiyks@gmail.com> Reviewed-by: David Gow <davidgow@google.com Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/sphinx')
-rw-r--r--Documentation/sphinx/templates/kernel-toc.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/sphinx/templates/kernel-toc.html b/Documentation/sphinx/templates/kernel-toc.html
new file mode 100644
index 000000000000..426312af8a8e
--- /dev/null
+++ b/Documentation/sphinx/templates/kernel-toc.html
@@ -0,0 +1,16 @@
+{# SPDX-License-Identifier: GPL-2.0 #}
+{# Create a local TOC the kernel way #}
+<p>
+<h3 class="kernel-toc-contents">Contents</h3>
+<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
+<label class="kernel-toc-title" for="kernel-toc-toggle"></label>
+
+<div class="kerneltoc" id="kerneltoc">
+{{ toctree(maxdepth=3) }}
+</div>
+{# hacky script to try to position the left column #}
+<script type="text/javascript"> <!--
+ var sbar = document.getElementsByClassName("sphinxsidebar")[0];
+ let currents = document.getElementsByClassName("current")
+ sbar.scrollTop = currents[currents.length - 1].offsetTop;
+ --> </script>