Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move version switcher next to the logo #23142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions doc/_static/mpl.css
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,22 @@ div.twocol > div {
display: inline-block;
margin: 0 0.5em;
}


/* styling for version switcher */
.navbar-brand {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this styling, but still opposed to moving next to the logo for aesthetic reasons.

/* pydata-sphinx-theme sets this as flex for some reason
but we cannot place the version switcher to its right then.
*/
display: inline-block;
}

#version_switcher {
display: inline-block;
}

#version_switcher_button {
color: rgba(var(--pst-color-text-base),1);
background-color: rgba(0,0,0,.03);
border: 1px solid rgba(0,0,0,.125);
}
9 changes: 7 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,14 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
"switcher": {
"json_url": "https://matplotlib.org/devdocs/_static/switcher.json",
"url_template": "https://matplotlib.org/{version}/",
"version_match": version,
"version_match": (
# The start version to show. This must be in switcher.json.
# We either go to 'stable' or to 'devdocs'
'stable' if matplotlib.__version_info__.releaselevel == 'final'
else 'devdocs')
},
"navbar_end": ["version-switcher", "mpl_icon_links"]
"navbar_start": ["mpl_navbar_logo", "version-switcher"],
"navbar_end": ["mpl_icon_links"]
}
include_analytics = is_release_build
if include_analytics:
Expand Down