Skip to content

Commit

Permalink
Add support for versions using the Pydata-Sphinx-Thme switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Jul 25, 2024
1 parent af5df33 commit f211e74
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
23 changes: 3 additions & 20 deletions doc/_static/css/custom_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,27 +205,10 @@ a[href="#join-our-community"] + ul li.toc-h3 {
display: none;
}

/* Version selector and header */
/* Version selector */

#versions-header {
color: rgb(0 0 0 / 65%);
font-size: 0.8rem;
margin-top: 1.1rem;
text-transform: uppercase;
}

#select-versions {
background-color: transparent;
border: 1px solid rgb(0 0 0 / 15%);
color: rgb(0 0 0 / 65%);
font-size: 90%;
margin-bottom: 7px;
padding: 2px;
}

#select-versions,
#select-versions option {
width: 98%;
.version-switcher__button {
margin-bottom: 0 !important;
}

/*** Styles for video transcript dropdown elements ***/
Expand Down
15 changes: 15 additions & 0 deletions doc/_static/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"version": "5",
"preferred": true,
"url": "https://docs.spyder-ide.org/5/"
},
{
"version": "4",
"url": "https://docs.spyder-ide.org/4/"
},
{
"version": "3",
"url": "https://docs.spyder-ide.org/3/"
}
]
6 changes: 6 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@
html_logo = "_static/images/spyder_logo.svg"
html_theme_options = {
"header_links_before_dropdown": 8,
"navbar_start": ["navbar-logo", "version-switcher"],
"navigation_with_keys": False,
"show_version_warning_banner": True,
"switcher": {
"json_url": "https://docs.spyder-ide.org/versions.json",
"version_match": version,
},
}
html_context = {
"github_user": "spyder-ide",
Expand Down

0 comments on commit f211e74

Please sign in to comment.