Skip to content

Commit c10d56c

Browse files
committed
ENH: add templates (maybe too many)
1 parent 5125861 commit c10d56c

File tree

7 files changed

+136
-0
lines changed

7 files changed

+136
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
<div class="sidebar-cheatsheets">
3+
<h3>Matplotlib cheatsheets</h3>
4+
<a href="https://github.com/matplotlib/cheatsheets#cheatsheets">
5+
<img src="_static/mpl_cheatsheet1.png"
6+
alt="Matplotlib cheatsheets"
7+
srcset="_static/mpl_cheatsheet1.png 1x, _static/mpl_cheatsheet1_2x.png 2x"/>
8+
</a>
9+
</div>

mpl_sphinx_theme/donate_sidebar.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
4+
<div class="sidebar-donate">
5+
<a href="https://numfocus.org/donate-to-matplotlib" target="_blank">
6+
<span class="mpl-button" >Support Matplotlib</span>
7+
</a>
8+
</div>

mpl_sphinx_theme/mpl_nav_bar.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<ul id="navbar-main-elements" class="navbar-nav">
2+
3+
<li class="nav-item">
4+
<a class="reference internal nav-link" href="{{ pathto('plot_types/index') }}">Plot types</a>
5+
</li>
6+
<li class="nav-item">
7+
<a class="reference internal nav-link" href="{{ pathto('gallery/index') }}">Examples</a>
8+
</li>
9+
<li class="nav-item">
10+
<a class="reference internal nav-link" href="{{ pathto('tutorials/index') }}">Tutorials</a>
11+
</li>
12+
<li class="nav-item">
13+
<a class="reference internal nav-link" href="{{ pathto('api/index') }}">Reference</a>
14+
</li>
15+
<li class="nav-item">
16+
<a class="reference internal nav-link" href="{{ pathto('users/index') }}">Usage guide</a>
17+
</li>
18+
<li class="nav-item">
19+
<a class="reference internal nav-link" href="{{ pathto('devel/index') }}">Develop</a>
20+
</li>
21+
<li class="nav-item">
22+
<a class="reference internal nav-link" href="{{ pathto('users/release_notes') }}">Release notes</a>
23+
</li>
24+
</ul>

mpl_sphinx_theme/pagesource.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{%- if show_source and has_source and sourcename %}
2+
<div id="sidebar-pagesource" role="note" aria-label="source link"
3+
style="margin-top: 1.5em; padding-top: 0.1em; border-top: 1px solid #86989b">
4+
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
5+
style="color: #c0c0c0" rel="nofollow">{{ _('Show Page Source') }}</a>
6+
</div>
7+
{%- endif %}

mpl_sphinx_theme/search.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{% extends "layout.html" %}
2+
{% set title = _('Search') %}
3+
{%- block scripts %}
4+
{{ super() }}
5+
<script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
6+
<script type="text/javascript" src="{{ pathto('_static/language_data.js', 1) }}"></script>
7+
{%- endblock %}
8+
{% block body %}
9+
<h1 id="search-documentation">{{ _('Search') }}</h1>
10+
<p>
11+
{% trans %}Searching for multiple words only shows matches that contain
12+
all words.{% endtrans %}
13+
</p>
14+
<p>
15+
If you want to limit your search to working code examples, include the
16+
keyword "codex" (mnemonic for <i>code example</i>) in your search, e.g.,
17+
"codex ellipse".
18+
</p>
19+
<form action="" method="get">
20+
<input type="text" name="q" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
21+
<input type="submit" value="{{ _('search') }}" />
22+
<span id="search-progress" style="padding-left: 10px"></span>
23+
</form>
24+
{% if search_performed %}
25+
<h2>{{ _('Search Results') }}</h2>
26+
{% if not search_results %}
27+
<p>{{ _('Your search did not match any results.') }}</p>
28+
{% endif %}
29+
{% endif %}
30+
<div id="search-results">
31+
{% if search_results %}
32+
<ul>
33+
{% for href, caption, context in search_results %}
34+
<li><a href="{{ pathto(item.href) }}">{{ caption }}</a>
35+
<div class="context">{{ context|e }}</div>
36+
</li>
37+
{% endfor %}
38+
</ul>
39+
{% endif %}
40+
</div>
41+
{% endblock %}
42+
{% block footer %}
43+
{{ super() }}
44+
<script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}" defer></script>
45+
{% endblock %}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="sidebar-announcement">
2+
<p>Matplotlib 3.0 is Python 3 only.</p>
3+
<p>Python 2 support has been dropped on January 1, 2020.</p>
4+
<p>The last Python 2 compatible release is 2.2.5.</p>
5+
</div>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<div class="sidebar-versions">
2+
<script>
3+
function getSnippet(id, url) {
4+
var req = false;
5+
// For Safari, Firefox, and other non-MS browsers
6+
if (window.XMLHttpRequest) {
7+
try {
8+
req = new XMLHttpRequest();
9+
} catch (e) {
10+
req = false;
11+
}
12+
} else if (window.ActiveXObject) {
13+
// For Internet Explorer on Windows
14+
try {
15+
req = new ActiveXObject("Msxml2.XMLHTTP");
16+
} catch (e) {
17+
try {
18+
req = new ActiveXObject("Microsoft.XMLHTTP");
19+
} catch (e) {
20+
req = false;
21+
}
22+
}
23+
}
24+
var element = document.querySelector(".sidebar-versions");
25+
if (req) {
26+
// Synchronous request, wait till we have it all
27+
req.open('GET', url, false);
28+
req.send(null);
29+
if (req.status == 200) {
30+
element.innerHTML = req.responseText;
31+
} else {
32+
element.innerHTML = "<mark>Could not find Snippet to insert at " + url + "</mark>"
33+
}
34+
}
35+
}
36+
getSnippet('other_versions', '/versions.html');
37+
</script>
38+
</div>

0 commit comments

Comments
 (0)