layout.html 5.6 KB

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