layout.html 7.4 KB

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