]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Doc: Show object descriptions in the table of contents (GH-125757) (#125841)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 22 Oct 2024 13:16:03 +0000 (15:16 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Oct 2024 13:16:03 +0000 (13:16 +0000)
(cherry picked from commit 91ddde4af0c3031c84a967bcf59f6fb4f8a48c0d)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/conf.py
Doc/tools/extensions/pyspecific.py
Doc/tools/static/sidebar-wrap.css [new file with mode: 0644]

index f8e13cd109d7f425e6d3b10195d74ae2d5d3f445..f4cf4ee9547e192957b02dfbb1a7b1ade6b816a9 100644 (file)
@@ -86,7 +86,8 @@ needs_sphinx = '7.2.6'
 
 # Create table of contents entries for domain objects (e.g. functions, classes,
 # attributes, etc.). Default is True.
-toc_object_entries = False
+toc_object_entries = True
+toc_object_entries_show_parents = 'hide'
 
 # Ignore any .rst files in the includes/ directory;
 # they're embedded in pages but not rendered individually.
index d3a4835edd58a4e2b2d9a446ff1c023fcf2751a4..8cb5eaffebfad089cd787af8a069977f20ecbd9d 100644 (file)
@@ -412,5 +412,6 @@ def setup(app):
     app.add_directive_to_domain('py', 'awaitablemethod', PyAwaitableMethod)
     app.add_directive_to_domain('py', 'abstractmethod', PyAbstractMethod)
     app.add_directive('miscnews', MiscNews)
+    app.add_css_file('sidebar-wrap.css')
     app.connect('env-check-consistency', patch_pairindextypes)
     return {'version': '1.0', 'parallel_read_safe': True}
diff --git a/Doc/tools/static/sidebar-wrap.css b/Doc/tools/static/sidebar-wrap.css
new file mode 100644 (file)
index 0000000..0a80f51
--- /dev/null
@@ -0,0 +1,6 @@
+div.sphinxsidebarwrapper {
+    overflow-x: scroll;
+}
+div.sphinxsidebarwrapper li code {
+    overflow-wrap: normal;
+}