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

Backport PR #16255 on branch v2.2.x (Move version info to sidebar)#16352

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall 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
15 changes: 12 additions & 3 deletionsdoc/_static/mpl.css
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1006,15 +1006,24 @@ div.viewcode-block:target {

}

.sidebar-announcement {
.sidebar-announcement,
.sidebar-versions {
border: 1px solid #11557C;
background: #eff9ff;
padding: 2px;
padding: 0.2em 0.5em;
margin-top: 1em;
}

.sidebar-announcement {
margin-top: 40px;
}

.sidebar-versions {
margin-top: 1em;
}

.sidebar-announcement p {
margin: 0.4em 0.4em 0.6em 0.4em;
margin: 0.4em 0 0.6em 0;
}

/* new main nav */
Expand Down
38 changes: 38 additions & 0 deletionsdoc/_templates/sidebar_versions.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
<div class="sidebar-versions">
<script>
function getSnippet(id, url) {
var req = false;
// For Safari, Firefox, and other non-MS browsers
if (window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch (e) {
req = false;
}
} else if (window.ActiveXObject) {
// For Internet Explorer on Windows
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
req = false;
}
}
}
var element = document.querySelector(".sidebar-versions");
if (req) {
// Synchronous request, wait till we have it all
req.open('GET', url, false);
req.send(null);
if (req.status == 200) {
element.innerHTML = req.responseText;
} else {
element.innerHTML = "<mark>Could not find Snippet to insert at " + url + "</mark>"
}
}
}
getSnippet('other_versions', '/versions.html');
</script>
</div>
2 changes: 1 addition & 1 deletiondoc/conf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -263,7 +263,7 @@ def _check_deps():

# Custom sidebar templates, maps page names to templates.
html_sidebars = {
'index': ['searchbox.html', 'sidebar_announcement.html',
'index': ['searchbox.html', 'sidebar_announcement.html', 'sidebar_versions.html',
'donate_sidebar.html'],
'**': ['searchbox.html', 'localtoc.html', 'relations.html',
'pagesource.html']
Expand Down
43 changes: 0 additions & 43 deletionsdoc/index.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,51 +54,8 @@ Visit the :doc:`Matplotlib installation instructions <users/installing>`.
Documentation
-------------

This is the documentation for Matplotlib version |version|.

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

.. raw:: html

<p id="other_versions"></p>

<script>
function getSnippet(id, url) {
var req = false;
// For Safari, Firefox, and other non-MS browsers
if (window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch (e) {
req = false;
}
} else if (window.ActiveXObject) {
// For Internet Explorer on Windows
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
req = false;
}
}
}
var element = document.getElementById(id);
if (req) {
// Synchronous request, wait till we have it all
req.open('GET', url, false);
req.send(null);
if (req.status == 200) {
element.innerHTML = req.responseText;
} else {
element.innerHTML = "<mark>Could not find Snippet to insert at " + url + "</mark>"
}
}
}
getSnippet('other_versions', '/versions.html');
</script>

Trying to learn how to do a particular kind of plot? Check out the
:doc:`examples gallery <gallery/index>` or the :doc:`list of plotting commands
<api/pyplot_summary>`.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp