Home | History | Annotate | Download | only in templates
      1 {% extends "!layout.html" %}
      2 {% block rootrellink %}
      3         <li><img src="{{ pathto('_static/py.png', 1) }}" alt=""
      4                  style="vertical-align: middle; margin-top: -1px"/></li>
      5         <li><a href="https://www.python.org/">Python</a>{{ reldelim1 }}</li>
      6         <li>
      7           {%- if switchers is defined %}
      8           <span class="language_switcher_placeholder">{{ language or 'en' }}</span>
      9           <span class="version_switcher_placeholder">{{ release }}</span>
     10           <a href="{{ pathto('index') }}">{% trans %}Documentation {% endtrans %}</a>{{ reldelim1 }}
     11           {%- else %}
     12           <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
     13           {%- endif %}
     14         </li>
     15 {% endblock %}
     16 {%- macro searchbox() %}
     17 {# modified from sphinx/themes/basic/searchbox.html #}
     18     {%- if builder != "htmlhelp" %}
     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>
     28     {%- endif %}
     29 {%- endmacro %}
     30 {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
     31 {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
     32 {% block relbaritems %}
     33     {%- if pagename != "search" and builder != "singlehtml" and builder != "htmlhelp" %}
     34     <li class="right">
     35         {{ searchbox() }}
     36         {{ reldelim2 }}
     37     </li>
     38     {%- endif %}
     39 {% endblock %}
     40 {% block extrahead %}
     41     <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
     42     <link rel="canonical" href="https://docs.python.org/3/{{pagename}}.html" />
     43     {% if builder != "htmlhelp" %}
     44     {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
     45     {% if switchers is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/switchers.js', 1) }}"></script>{% endif %}
     46     {% if pagename == 'whatsnew/changelog' and not embedded %}
     47     <script type="text/javascript">
     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               });
     97           }
     98           $('#searchbox').keyup(dofilter);
     99           $('#searchbox-submit').click(dofilter);
    100       });
    101     </script>
    102     {% endif %}
    103     {% endif %}
    104     {# custom CSS; used in asyncio docs! #}
    105     <style>
    106       @media only screen {{ "{" }}
    107         table.full-width-table {{ "{" }}
    108             width: 100%;
    109         {{ "}" }}
    110       {{ "}" }}
    111     </style>
    112 {{ super() }}
    113 {% endblock %}
    114 {% block footer %}
    115     <div class="footer">
    116     &copy; <a href="{{ pathto('copyright') }}">{% trans %}Copyright{% endtrans %}</a> {{ copyright|e }}.
    117     <br />
    118     {% trans %}The Python Software Foundation is a non-profit corporation.{% endtrans %}
    119     <a href="https://www.python.org/psf/donations/">{% trans %}Please donate.{% endtrans %}</a>
    120     <br />
    121     {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
    122     {% trans pathto_bugs=pathto('bugs') %}<a href="{{ pathto_bugs }}">Found a bug</a>?{% endtrans %}
    123     <br />
    124     {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
    125     </div>
    126 {% endblock %}
    127