]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Doc: Show object descriptions in the table of contents (#125757)
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>
Tue, 22 Oct 2024 13:07:09 +0000 (14:07 +0100)
committerGitHub <noreply@github.com>
Tue, 22 Oct 2024 13:07:09 +0000 (14:07 +0100)
Doc/conf.py
Doc/tools/extensions/pyspecific.py
Doc/tools/static/sidebar-wrap.css [new file with mode: 0644]

index db8fb9a9a68c6b9e9f31d198e4a4cf1b4fc9aa5a..7ee3c91581345db7ddc37850fd86c4b708ef3455 100644 (file)
@@ -94,7 +94,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 bcb8a421e32d09e12b93af3ac06e162901418692..f4df7ec0839339ecf9ad48c778eb1f25c8a6643f 100644 (file)
@@ -434,5 +434,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;
+}