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

Skip to content

Commit 72ceee0

Browse files
committed
Restore dynamic versions.
1 parent 8055b63 commit 72ceee0

1 file changed

Lines changed: 39 additions & 5 deletions

File tree

doc/index.rst

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,46 @@ This is the documentation for Matplotlib version |version|.
5656

5757
To get started, read the :doc:`User's Guide <users/index>`.
5858

59-
Other versions are available:
59+
.. raw:: html
6060

61-
- `2.1.0 <http://matplotlib.org/2.1.0/index.html>`_: Latest stable version.
62-
- `2.x <http://matplotlib.org/devdocs/index.html>`_: Latest git master (unstable).
63-
- `2.0.2 <http://matplotlib.org/2.0.2/index.html>`_: Previous stable version.
64-
- `1.5.3 <http://matplotlib.org/1.5.3/index.html>`_: Older stable version.
61+
<p id="other_versions"></p>
62+
63+
<script>
64+
function getSnippet(id, url) {
65+
var req = false;
66+
// For Safari, Firefox, and other non-MS browsers
67+
if (window.XMLHttpRequest) {
68+
try {
69+
req = new XMLHttpRequest();
70+
} catch (e) {
71+
req = false;
72+
}
73+
} else if (window.ActiveXObject) {
74+
// For Internet Explorer on Windows
75+
try {
76+
req = new ActiveXObject("Msxml2.XMLHTTP");
77+
} catch (e) {
78+
try {
79+
req = new ActiveXObject("Microsoft.XMLHTTP");
80+
} catch (e) {
81+
req = false;
82+
}
83+
}
84+
}
85+
var element = document.getElementById(id);
86+
if (req) {
87+
// Synchronous request, wait till we have it all
88+
req.open('GET', url, false);
89+
req.send(null);
90+
if (req.status == 200) {
91+
element.innerHTML = req.responseText;
92+
} else {
93+
element.innerHTML = "<mark>Could not find Snippet to insert at " + url + "</mark>"
94+
}
95+
}
96+
}
97+
getSnippet('other_versions', '/versions.html');
98+
</script>
6599

66100
Trying to learn how to do a particular kind of plot? Check out the
67101
:doc:`examples gallery <gallery/index>` or the :doc:`list of plotting commands

0 commit comments

Comments
 (0)