layout.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. <div class="wy-grid-for-nav">
  72. {# SIDE NAV, TOGGLES ON MOBILE #}
  73. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  74. <div class="wy-side-scroll">
  75. <div class="wy-side-nav-search">
  76. {% block sidebartitle %}
  77. {% if logo and theme_logo_only %}
  78. <a href="{{ pathto(master_doc) }}">
  79. {% else %}
  80. <a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
  81. {% endif %}
  82. {% if logo %}
  83. {# Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #}
  84. <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" />
  85. {% endif %}
  86. </a>
  87. {% if theme_display_version %}
  88. {%- set nav_version = version %}
  89. {% if READTHEDOCS and current_version %}
  90. {%- set nav_version = current_version %}
  91. {% endif %}
  92. {% if nav_version %}
  93. <div class="version">
  94. {{ nav_version }}
  95. </div>
  96. {% endif %}
  97. {% endif %}
  98. {% include "searchbox.html" %}
  99. {% endblock %}
  100. </div>
  101. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  102. {% block menu %}
  103. {% set toctree = toctree(maxdepth=4, collapse=theme_collapse_navigation, includehidden=True) %}
  104. {% if toctree %}
  105. {{ toctree }}
  106. {% else %}
  107. <!-- Local TOC -->
  108. <div class="local-toc">{{ toc }}</div>
  109. {% endif %}
  110. {% endblock %}
  111. </div>
  112. </div>
  113. </nav>
  114. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  115. {# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
  116. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  117. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  118. <a href="{{ pathto(master_doc) }}">{{ project }}</a>
  119. </nav>
  120. {# PAGE CONTENT #}
  121. <div class="wy-nav-content">
  122. <div class="rst-content">
  123. {% include "breadcrumbs.html" %}
  124. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  125. <div itemprop="articleBody">
  126. {% block body %}{% endblock %}
  127. </div>
  128. </div>
  129. {% include "footer.html" %}
  130. </div>
  131. </div>
  132. </section>
  133. </div>
  134. {% include "versions.html" %}
  135. {% if not embedded %}
  136. <script type="text/javascript">
  137. var DOCUMENTATION_OPTIONS = {
  138. URL_ROOT:'{{ url_root }}',
  139. VERSION:'{{ release|e }}',
  140. COLLAPSE_INDEX:false,
  141. FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
  142. HAS_SOURCE: {{ has_source|lower }}
  143. };
  144. </script>
  145. {%- for scriptfile in script_files %}
  146. <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
  147. {%- endfor %}
  148. {% endif %}
  149. {# RTD hosts this file, so just load on non RTD builds #}
  150. {% if not READTHEDOCS %}
  151. <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
  152. {% endif %}
  153. {# STICKY NAVIGATION #}
  154. {% if theme_sticky_navigation %}
  155. <script type="text/javascript">
  156. jQuery(function () {
  157. SphinxRtdTheme.StickyNav.enable();
  158. });
  159. </script>
  160. {% endif %}
  161. {%- block footer %} {% endblock %}
  162. </body>
  163. </html>