layout.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. {# TEMPLATE VAR SETTINGS #}
  2. {%- set url_root = pathto('', 1) %}
  3. {%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
  4. {%- if not embedded and docstitle %}
  5. {%- set titlesuffix = " — "|safe + docstitle|e %}
  6. {%- else %}
  7. {%- set titlesuffix = "" %}
  8. {%- endif %}
  9. <!DOCTYPE html>
  10. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  11. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  12. <head>
  13. <meta charset="utf-8">
  14. {{ metatags }}
  15. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  16. {% block htmltitle %}
  17. <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
  18. {% endblock %}
  19. {# FAVICON #}
  20. {% if favicon %}
  21. <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
  22. {% endif %}
  23. {# CSS #}
  24. {# OPENSEARCH #}
  25. {% if not embedded %}
  26. {% if use_opensearch %}
  27. <link rel="search" type="application/opensearchdescription+xml" title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" href="{{ pathto('_static/opensearch.xml', 1) }}"/>
  28. {% endif %}
  29. {% endif %}
  30. {# RTD hosts this file, so just load on non RTD builds #}
  31. {% if not READTHEDOCS %}
  32. <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
  33. {% endif %}
  34. {% for cssfile in css_files %}
  35. <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
  36. {% endfor %}
  37. {% for cssfile in extra_css_files %}
  38. <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
  39. {% endfor %}
  40. {%- block linktags %}
  41. {%- if hasdoc('about') %}
  42. <link rel="author" title="{{ _('About these documents') }}"
  43. href="{{ pathto('about') }}"/>
  44. {%- endif %}
  45. {%- if hasdoc('genindex') %}
  46. <link rel="index" title="{{ _('Index') }}"
  47. href="{{ pathto('genindex') }}"/>
  48. {%- endif %}
  49. {%- if hasdoc('search') %}
  50. <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}"/>
  51. {%- endif %}
  52. {%- if hasdoc('copyright') %}
  53. <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}"/>
  54. {%- endif %}
  55. <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}"/>
  56. {%- if parents %}
  57. <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}"/>
  58. {%- endif %}
  59. {%- if next %}
  60. <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}"/>
  61. {%- endif %}
  62. {%- if prev %}
  63. <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}"/>
  64. {%- endif %}
  65. {%- endblock %}
  66. {%- block extrahead %} {% endblock %}
  67. {# Keep modernizr in head - http://modernizr.com/docs/#installing #}
  68. <script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
  69. </head>
  70. <body class="wy-body-for-nav" role="document">
  71. {% block extrabody %} {% endblock %}
  72. <div class="wy-grid-for-nav">
  73. {# SIDE NAV, TOGGLES ON MOBILE #}
  74. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  75. <div class="wy-side-scroll">
  76. <div class="wy-side-nav-search">
  77. {% block sidebartitle %}
  78. {% if logo and theme_logo_only %}
  79. <a href="{{ pathto(master_doc) }}">
  80. {% else %}
  81. <a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
  82. {% endif %}
  83. {% if logo %}
  84. {# Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #}
  85. <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" />
  86. {% endif %}
  87. </a>
  88. {% if theme_display_version %}
  89. {%- set nav_version = version %}
  90. {% if READTHEDOCS and current_version %}
  91. {%- set nav_version = current_version %}
  92. {% endif %}
  93. {% if nav_version %}
  94. <div class="version">
  95. {{ nav_version }}
  96. </div>
  97. {% endif %}
  98. {% endif %}
  99. {% include "searchbox.html" %}
  100. {% endblock %}
  101. </div>
  102. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  103. {% block menu %}
  104. {% set toctree = toctree(maxdepth=4, collapse=theme_collapse_navigation, includehidden=True) %}
  105. {% if toctree %}
  106. {{ toctree }}
  107. {% else %}
  108. <!-- Local TOC -->
  109. <div class="local-toc">{{ toc }}</div>
  110. {% endif %}
  111. {% endblock %}
  112. </div>
  113. </div>
  114. </nav>
  115. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  116. {# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
  117. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  118. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  119. <a href="{{ pathto(master_doc) }}">{{ project }}</a>
  120. </nav>
  121. {# PAGE CONTENT #}
  122. <div class="wy-nav-content">
  123. <div class="rst-content">
  124. {% include "breadcrumbs.html" %}
  125. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  126. <div itemprop="articleBody">
  127. {% block body %}{% endblock %}
  128. </div>
  129. </div>
  130. {% include "footer.html" %}
  131. </div>
  132. </div>
  133. </section>
  134. </div>
  135. {% include "versions.html" %}
  136. {% if not embedded %}
  137. <script type="text/javascript">
  138. var DOCUMENTATION_OPTIONS = {
  139. URL_ROOT:'{{ url_root }}',
  140. VERSION:'{{ release|e }}',
  141. COLLAPSE_INDEX:false,
  142. FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
  143. HAS_SOURCE: {{ has_source|lower }}
  144. };
  145. </script>
  146. {%- for scriptfile in script_files %}
  147. <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
  148. {%- endfor %}
  149. {% endif %}
  150. {# RTD hosts this file, so just load on non RTD builds #}
  151. {% if not READTHEDOCS %}
  152. <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
  153. {% endif %}
  154. {# STICKY NAVIGATION #}
  155. {% if theme_sticky_navigation %}
  156. <script type="text/javascript">
  157. jQuery(function () {
  158. SphinxRtdTheme.StickyNav.enable();
  159. });
  160. </script>
  161. {% endif %}
  162. {%- block footer %} {% endblock %}
  163. </body>
  164. </html>