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

Skip to content

Commit 1fb8c74

Browse files
authored
Merge pull request #22246 from jklymak/doc-add-version-dropdown
DOC: add dropdown
2 parents 76012ae + 38cdca0 commit 1fb8c74

File tree

4 files changed

+120
-1
lines changed

4 files changed

+120
-1
lines changed

doc/_static/switcher.json

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
[
2+
{
3+
"name": "3.5.1 (stable)",
4+
"version": "stable"
5+
},
6+
{
7+
"name": "3.6 (devdocs)",
8+
"version": "devdocs"
9+
},
10+
{
11+
"version": "3.5.0"
12+
},
13+
{
14+
"version": "3.4.3"
15+
},
16+
{
17+
"version": "3.4.2"
18+
},
19+
{
20+
"version": "3.4.1"
21+
},
22+
{
23+
"version": "3.4.0"
24+
},
25+
{
26+
"version": "3.3.4"
27+
},
28+
{
29+
"version": "3.3.3"
30+
},
31+
{
32+
"version": "3.3.2"
33+
},
34+
{
35+
"version": "3.3.1"
36+
},
37+
{
38+
"version": "3.3.0"
39+
},
40+
{
41+
"version": "3.2.2"
42+
},
43+
{
44+
"version": "3.2.1"
45+
},
46+
{
47+
"version": "3.2.0"
48+
},
49+
{
50+
"version": "3.1.3"
51+
},
52+
{
53+
"version": "3.1.2"
54+
},
55+
{
56+
"version": "3.1.1"
57+
},
58+
{
59+
"version": "3.1.0"
60+
},
61+
{
62+
"version": "3.0.3"
63+
},
64+
{
65+
"version": "3.0.2"
66+
},
67+
{
68+
"version": "3.0.1"
69+
},
70+
{
71+
"version": "3.0.0"
72+
},
73+
{
74+
"name": "2.2",
75+
"version": "2.2.4"
76+
},
77+
{
78+
"name": "2.1",
79+
"version": "2.1.2"
80+
},
81+
{
82+
"name": "2.0",
83+
"version": "2.0.2"
84+
},
85+
{
86+
"name": "1.5",
87+
"version": "1.5.3"
88+
},
89+
{
90+
"name": "1.5",
91+
"version": "1.5.3"
92+
},
93+
{
94+
"name": "1.4",
95+
"version": "1.4.3"
96+
},
97+
{
98+
"name": "1.3",
99+
"version": "1.3.1"
100+
},
101+
{
102+
"name": "1.2",
103+
"version": "1.2.1"
104+
},
105+
]

doc/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf,
323323
# and CI builds https://github.com/pydata/pydata-sphinx-theme/pull/386
324324
"collapse_navigation": not is_release_build,
325325
"show_prev_next": False,
326+
"switcher": {
327+
"json_url": "https://matplotlib.org/en/devdocs/_static/switcher.json",
328+
"url_template": "https://matplotlib.org/{version}/"
329+
},
330+
"navbar_end": ["version-switcher", "mpl_icon_links"]
326331
}
327332
include_analytics = is_release_build
328333
if include_analytics:

doc/devel/release_guide.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ Update :file:`doc/users/release_notes.rst`:
141141
prev_whats_new/whats_new_X.Y.0.rst
142142
../api/prev_api_changes/api_changes_X.Y.0.rst
143143
prev_whats_new/github_stats_X.Y.0.rst
144-
145144
- For bugfix releases add the GitHub stats and (if present) the API changes to
146145
the existing X.Y section
147146

@@ -150,6 +149,15 @@ Update :file:`doc/users/release_notes.rst`:
150149
../api/prev_api_changes/api_changes_X.Y.Z.rst
151150
prev_whats_new/github_stats_X.Y.Z.rst
152151
152+
Update version switcher
153+
~~~~~~~~~~~~~~~~~~~~~~~
154+
155+
Update ``doc/_static/switcher.json``. If a minor release, ``X.Y.Z``, create
156+
a new entry ``version: X.Y.(Z-1)``, and change the name of stable
157+
``name: stable/X.Y.Z``. If a major release, ``X.Y.0``, change the name
158+
of ``name: devel/X.(Y+1)`` and ``name: stable/X.Y.0`` as well as adding
159+
a new version for the previous stable.
160+
153161
Verify that docs build
154162
----------------------
155163

requirements/doc/doc-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ipython
1313
ipywidgets
1414
numpydoc>=0.8
1515
packaging>=20
16+
pydata-sphinx-theme>=0.8.0
1617
mpl-sphinx-theme
1718
sphinxcontrib-svg2pdfconverter>=1.1.0
1819
sphinx-gallery>=0.10

0 commit comments

Comments
 (0)