Georg Brandl | e757005 | 2008-05-03 20:52:18 +0000 | [diff] [blame] | 1 | {% extends "!layout.html" %} |
| 2 | {% block rootrellink %} |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 3 | <li><img src="{{ pathto('_static/py.png', 1) }}" alt="" |
| 4 | style="vertical-align: middle; margin-top: -1px"/></li> |
Georg Brandl | 46761ec | 2014-10-29 08:36:15 +0100 | [diff] [blame] | 5 | <li><a href="https://www.python.org/">Python</a>{{ reldelim1 }}</li> |
Ezio Melotti | 380ce65 | 2012-10-27 22:09:16 +0300 | [diff] [blame] | 6 | <li> |
Julien | dff9b5f | 2017-08-07 10:27:21 +0200 | [diff] [blame] | 7 | {%- if switchers is defined %} |
| 8 | <span class="language_switcher_placeholder">{{ language or 'en' }}</span> |
Ezio Melotti | 380ce65 | 2012-10-27 22:09:16 +0300 | [diff] [blame] | 9 | <span class="version_switcher_placeholder">{{ release }}</span> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 10 | <a href="{{ pathto('index') }}">{% trans %}Documentation {% endtrans %}</a>{{ reldelim1 }} |
Ezio Melotti | 380ce65 | 2012-10-27 22:09:16 +0300 | [diff] [blame] | 11 | {%- else %} |
| 12 | <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }} |
| 13 | {%- endif %} |
| 14 | </li> |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 15 | {% endblock %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 16 | {%- macro searchbox() %} |
| 17 | {# modified from sphinx/themes/basic/searchbox.html #} |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame] | 18 | {%- if builder != "htmlhelp" %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 19 | <div class="inline-search" style="display: none" role="search"> |
| 20 | <form class="inline-search" action="{{ pathto('search') }}" method="get"> |
| 21 | <input placeholder="{{ _('Quick search') }}" type="text" name="q" /> |
| 22 | <input type="submit" value="{{ _('Go') }}" /> |
| 23 | <input type="hidden" name="check_keywords" value="yes" /> |
| 24 | <input type="hidden" name="area" value="default" /> |
| 25 | </form> |
| 26 | </div> |
| 27 | <script type="text/javascript">$('.inline-search').show(0);</script> |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame] | 28 | {%- endif %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 29 | {%- endmacro %} |
Georg Brandl | 1afe2af | 2014-03-25 10:12:47 +0100 | [diff] [blame] | 30 | {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} |
| 31 | {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 32 | {% block relbaritems %} |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame] | 33 | {%- if pagename != "search" and builder != "singlehtml" and builder != "htmlhelp" %} |
Zachary Ware | a3090a4 | 2016-09-09 13:11:27 -0700 | [diff] [blame] | 34 | <li class="right"> |
| 35 | {{ searchbox() }} |
| 36 | {{ reldelim2 }} |
| 37 | </li> |
| 38 | {%- endif %} |
| 39 | {% endblock %} |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 40 | {% block extrahead %} |
| 41 | <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" /> |
Nick Coghlan | e662445 | 2017-02-09 16:03:59 +0100 | [diff] [blame] | 42 | <link rel="canonical" href="https://docs.python.org/3/{{pagename}}.html" /> |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame] | 43 | {% if builder != "htmlhelp" %} |
Ezio Melotti | 4342722 | 2012-02-25 19:24:24 +0200 | [diff] [blame] | 44 | {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %} |
Julien | dff9b5f | 2017-08-07 10:27:21 +0200 | [diff] [blame] | 45 | {% if switchers is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/switchers.js', 1) }}"></script>{% endif %} |
Benjamin Peterson | c836f71 | 2016-01-20 22:02:30 -0800 | [diff] [blame] | 46 | {% if pagename == 'whatsnew/changelog' and not embedded %} |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 47 | <script type="text/javascript"> |
Ezio Melotti | 7eb03dd | 2012-10-02 01:43:42 +0300 | [diff] [blame] | 48 | $(document).ready(function() { |
| 49 | // add the search form and bind the events |
| 50 | $('h1').after([ |
| 51 | '<p>Filter entries by content:', |
| 52 | '<input type="text" value="" id="searchbox" style="width: 50%">', |
| 53 | '<input type="submit" id="searchbox-submit" value="Filter"></p>' |
| 54 | ].join('\n')); |
| 55 | |
| 56 | function dofilter() { |
| 57 | try { |
| 58 | var query = new RegExp($('#searchbox').val(), 'i'); |
| 59 | } |
| 60 | catch (e) { |
| 61 | return; // not a valid regex (yet) |
| 62 | } |
| 63 | // find headers for the versions (What's new in Python X.Y.Z?) |
| 64 | $('#changelog h2').each(function(index1, h2) { |
| 65 | var h2_parent = $(h2).parent(); |
| 66 | var sections_found = 0; |
| 67 | // find headers for the sections (Core, Library, etc.) |
| 68 | h2_parent.find('h3').each(function(index2, h3) { |
| 69 | var h3_parent = $(h3).parent(); |
| 70 | var entries_found = 0; |
| 71 | // find all the entries |
| 72 | h3_parent.find('li').each(function(index3, li) { |
| 73 | var li = $(li); |
| 74 | // check if the query matches the entry |
| 75 | if (query.test(li.text())) { |
| 76 | li.show(); |
| 77 | entries_found++; |
| 78 | } |
| 79 | else { |
| 80 | li.hide(); |
| 81 | } |
| 82 | }); |
| 83 | // if there are entries, show the section, otherwise hide it |
| 84 | if (entries_found > 0) { |
| 85 | h3_parent.show(); |
| 86 | sections_found++; |
| 87 | } |
| 88 | else { |
| 89 | h3_parent.hide(); |
| 90 | } |
| 91 | }); |
| 92 | if (sections_found > 0) |
| 93 | h2_parent.show(); |
| 94 | else |
| 95 | h2_parent.hide(); |
| 96 | }); |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 97 | } |
Ezio Melotti | 7eb03dd | 2012-10-02 01:43:42 +0300 | [diff] [blame] | 98 | $('#searchbox').keyup(dofilter); |
| 99 | $('#searchbox-submit').click(dofilter); |
| 100 | }); |
Georg Brandl | 2cac28b | 2012-09-30 15:10:06 +0200 | [diff] [blame] | 101 | </script> |
| 102 | {% endif %} |
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame] | 103 | {% endif %} |
Georg Brandl | af265f4 | 2008-12-07 15:06:20 +0000 | [diff] [blame] | 104 | {{ super() }} |
Georg Brandl | e757005 | 2008-05-03 20:52:18 +0000 | [diff] [blame] | 105 | {% endblock %} |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 106 | {% block footer %} |
| 107 | <div class="footer"> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 108 | © <a href="{{ pathto('copyright') }}">{% trans %}Copyright{% endtrans %}</a> {{ copyright|e }}. |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 109 | <br /> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 110 | {% trans %}The Python Software Foundation is a non-profit corporation.{% endtrans %} |
| 111 | <a href="https://www.python.org/psf/donations/">{% trans %}Please donate.{% endtrans %}</a> |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 112 | <br /> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 113 | {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} |
| 114 | {% trans pathto_bugs=pathto('bugs') %}<a href="{{ pathto_bugs }}">Found a bug</a>?{% endtrans %} |
Georg Brandl | 582c0a6 | 2010-04-22 23:20:19 +0000 | [diff] [blame] | 115 | <br /> |
Victor Stinner | 875f29a | 2016-01-22 18:00:05 +0100 | [diff] [blame] | 116 | {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} |
Georg Brandl | 3eb562b | 2009-08-04 20:25:54 +0000 | [diff] [blame] | 117 | </div> |
| 118 | {% endblock %} |