Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3ef253

Browse files
authored
Merge pull request#127 from AA-Turner/sphinx-5-fixup
2 parentsaaca238 +d39c311 commite3ef253

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎python_docs_theme/static/sidebar.jsrenamed to‎python_docs_theme/static/sidebar.js_t

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ const initialiseSidebar = () => {
3636
return
3737
}
3838

39+
{# Check if we need to dynamically insert the sidebar button.
40+
# We prefer the ``sphinx_version_tuple`` variable, and if it is undefined we
41+
# know we are running a Sphinx version older than 4.2.
42+
#
43+
# See: https://www.sphinx-doc.org/en/master/development/templating.html#sphinx_version_tuple
44+
#}
45+
{% if sphinx_version_tuple is defined and sphinx_version_tuple[0] >= 5 %}
46+
const sidebarButton = document.getElementById("sidebarbutton")
47+
const sidebarArrow = sidebarButton.querySelector('span')
48+
{% else %}
3949
// create the sidebar button element
4050
const sidebarButton = document.createElement("div")
4151
sidebarButton.id = "sidebarbutton"
@@ -44,6 +54,7 @@ const initialiseSidebar = () => {
4454
sidebarArrow.innerText = "«"
4555
sidebarButton.appendChild(sidebarArrow)
4656
sidebar.appendChild(sidebarButton)
57+
{% endif %}
4758

4859
const collapse_sidebar = () => {
4960
bodyWrapper.style.marginLeft = ".8em"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp