1 {# 2 basic/layout.html 3 ~~~~~~~~~~~~~~~~~ 4 5 Master layout template for Sphinx themes. 6 7 :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 :license: BSD, see LICENSE for details. 9 #} 10 {%- block doctype -%} 11 <!DOCTYPE html> 12 {%- endblock %} 13 {%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} 14 {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} 15 {%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and 16 (sidebars != []) %} 17 {%- set url_root = pathto('', 1) %} 18 {# XXX necessary? #} 19 {%- if url_root == '#' %}{% set url_root = '' %}{% endif %} 20 {%- if not embedded and docstitle %} 21 {%- set titlesuffix = " — "|safe + docstitle|e %} 22 {%- else %} 23 {%- set titlesuffix = "" %} 24 {%- endif %} 25 26 {%- macro relbar() %} 27 <div class="related" role="navigation" aria-label="related navigation"> 28 <h3>{{ _('Navigation') }}</h3> 29 <ul> 30 {%- for rellink in rellinks %} 31 <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> 32 <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" 33 {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> 34 {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li> 35 {%- endfor %} 36 {%- block rootrellink %} 37 <li class="nav-item nav-item-0"><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li> 38 {%- endblock %} 39 {%- for parent in parents %} 40 <li class="nav-item nav-item-{{ loop.index }}"><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li> 41 {%- endfor %} 42 {%- block relbaritems %} {% endblock %} 43 </ul> 44 </div> 45 {%- endmacro %} 46 47 {%- macro sidebar() %} 48 {%- if render_sidebar %} 49 <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> 50 <div class="sphinxsidebarwrapper"> 51 {%- block sidebarlogo %} 52 {%- if logo %} 53 <p class="logo"><a href="{{ pathto(master_doc) }}"> 54 <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> 55 </a></p> 56 {%- endif %} 57 {%- endblock %} 58 {%- if sidebars != None %} 59 {#- new style sidebar: explicitly include/exclude templates #} 60 {%- for sidebartemplate in sidebars %} 61 {%- include sidebartemplate %} 62 {%- endfor %} 63 {%- else %} 64 {#- old style sidebars: using blocks -- should be deprecated #} 65 {%- block sidebartoc %} 66 {%- include "localtoc.html" %} 67 {%- endblock %} 68 {%- block sidebarrel %} 69 {%- include "relations.html" %} 70 {%- endblock %} 71 {%- block sidebarsourcelink %} 72 {%- include "sourcelink.html" %} 73 {%- endblock %} 74 {%- if customsidebar %} 75 {%- include customsidebar %} 76 {%- endif %} 77 {%- block sidebarsearch %} 78 {%- include "searchbox.html" %} 79 {%- endblock %} 80 {%- endif %} 81 </div> 82 </div> 83 {%- endif %} 84 {%- endmacro %} 85 86 {%- macro script() %} 87 <script type="text/javascript"> 88 var DOCUMENTATION_OPTIONS = { 89 URL_ROOT: '{{ url_root }}', 90 VERSION: '{{ release|e }}', 91 COLLAPSE_INDEX: false, 92 FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}', 93 HAS_SOURCE: {{ has_source|lower }} 94 }; 95 </script> 96 {%- for scriptfile in script_files %} 97 <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> 98 {%- endfor %} 99 {%- endmacro %} 100 101 {%- macro css() %} 102 <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> 103 <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> 104 {%- for cssfile in css_files %} 105 <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> 106 {%- endfor %} 107 {%- endmacro %} 108 109 <html lang="en"> 110 <head> 111 <meta charset="{{ encoding }}"> 112 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 113 <meta name="viewport" content="width=device-width, initial-scale=1"> 114 {# The above 3 meta tags *must* come first in the head; any other head content 115 must come *after* these tags. #} 116 {{ metatags }} 117 {%- block htmltitle %} 118 <title>{{ title|striptags|e }}{{ titlesuffix }}</title> 119 {%- endblock %} 120 {{ css() }} 121 {%- if not embedded %} 122 {{ script() }} 123 {%- if use_opensearch %} 124 <link rel="search" type="application/opensearchdescription+xml" 125 title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" 126 href="{{ pathto('_static/opensearch.xml', 1) }}"/> 127 {%- endif %} 128 {%- if favicon %} 129 <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> 130 {%- endif %} 131 {%- endif %} 132 {%- block linktags %} 133 {%- if hasdoc('about') %} 134 <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> 135 {%- endif %} 136 {%- if hasdoc('genindex') %} 137 <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" /> 138 {%- endif %} 139 {%- if hasdoc('search') %} 140 <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" /> 141 {%- endif %} 142 {%- if hasdoc('copyright') %} 143 <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" /> 144 {%- endif %} 145 {%- if parents %} 146 <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" /> 147 {%- endif %} 148 {%- if next %} 149 <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" /> 150 {%- endif %} 151 {%- if prev %} 152 <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" /> 153 {%- endif %} 154 {%- endblock %} 155 {%- block extrahead %} {% endblock %} 156 </head> 157 <body role="document"> 158 {%- block header %}{% endblock %} 159 160 {%- block relbar1 %}{{ relbar() }}{% endblock %} 161 162 {%- block content %} 163 {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} 164 165 <div class="document"> 166 {%- block document %} 167 <div class="documentwrapper"> 168 {%- if render_sidebar %} 169 <div class="bodywrapper"> 170 {%- endif %} 171 <div class="body" role="main"> 172 {% block body %} {% endblock %} 173 </div> 174 {%- if render_sidebar %} 175 </div> 176 {%- endif %} 177 </div> 178 {%- endblock %} 179 180 {%- block sidebar2 %}{{ sidebar() }}{% endblock %} 181 <div class="clearer"></div> 182 </div> 183 {%- endblock %} 184 185 {%- block relbar2 %}{{ relbar() }}{% endblock %} 186 187 {%- block footer %} 188 <div class="footer" role="contentinfo"> 189 {%- if show_copyright %} 190 {%- if hasdoc('copyright') %} 191 {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} 192 {%- else %} 193 {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} 194 {%- endif %} 195 {%- endif %} 196 {%- if last_updated %} 197 {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} 198 {%- endif %} 199 {%- if show_sphinx %} 200 {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} 201 {%- endif %} 202 </div> 203 {%- endblock %} 204 </body> 205 </html> 206