Debian Codegraph @

sphinx_rtd_theme/layout.html

raw
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 {%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %}
10
11 {# Build sphinx_version_info tuple from sphinx_version string in pure Jinja #}
12 {%- set (_ver_major, _ver_minor) = (sphinx_version.split('.') | list)[:2] | map('int') -%}
13 {%- set sphinx_version_info = (_ver_major, _ver_minor, -1) -%}
14
15 <!DOCTYPE html>
16 <html class="writer-html5" lang="{{ lang_attr }}"{% if sphinx_version_info >= (7, 2) %} data-content_root="{{ content_root }}"{% endif %}>
17 <head>
18 <meta charset="utf-8" />
19 {%- if READTHEDOCS and not embedded %}
20 <meta name="readthedocs-addons-api-version" content="1">
21 {%- endif %}
22 {{- metatags }}
23 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
24 {%- block htmltitle %}
25 <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
26 {%- endblock -%}
27
28 {#- CSS #}
29 {%- for css_file in css_files %}
30 {%- if css_file|attr("filename") %}
31 {{ css_tag(css_file) }}
32 {%- else %}
33 <link rel="stylesheet" href="{{ pathto(css_file, 1)|escape }}" type="text/css" />
34 {%- endif %}
35 {%- endfor %}
36
37 {#
38 "extra_css_files" is an undocumented Read the Docs theme specific option.
39 There is no need to check for ``|attr("filename")`` here because it's always a string.
40 Note that this option should be removed in favor of regular ``html_css_files``:
41 https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_css_files
42 #}
43 {%- for css_file in extra_css_files %}
44 <link rel="stylesheet" href="{{ pathto(css_file, 1)|escape }}" type="text/css" />
45 {%- endfor -%}
46
47 {#- FAVICON #}
48 {%- if favicon_url %}
49 <link rel="shortcut icon" href="{{ favicon_url }}"/>
50 {%- endif %}
51
52 {#- CANONICAL URL (deprecated) #}
53 {%- if theme_canonical_url and not pageurl %}
54 <link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html"/>
55 {%- endif -%}
56
57 {#- CANONICAL URL #}
58 {%- if pageurl %}
59 <link rel="canonical" href="{{ pageurl|e }}" />
60 {%- endif -%}
61
62 {#- JAVASCRIPTS #}
63 {%- block scripts %}
64 {%- if not embedded %}
65 {%- for scriptfile in script_files %}
66 {{ js_tag(scriptfile) }}
67 {%- endfor %}
68 <script src="{{ pathto('_static/js/theme.js', 1) }}"></script>
69
70 {%- if READTHEDOCS or DEBUG %}
71 <script src="{{ pathto('_static/js/versions.js', 1) }}"></script>
72 {%- endif %}
73
74 {#- OPENSEARCH #}
75 {%- if use_opensearch %}
76 <link rel="search" type="application/opensearchdescription+xml"
77 title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
78 href="{{ pathto('_static/opensearch.xml', 1) }}"/>
79 {%- endif %}
80 {%- endif %}
81 {%- endblock %}
82
83 {%- block linktags %}
84 {%- if hasdoc('about') %}
85 <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
86 {%- endif %}
87 {%- if hasdoc('genindex') %}
88 <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
89 {%- endif %}
90 {%- if hasdoc('search') %}
91 <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
92 {%- endif %}
93 {%- if hasdoc('copyright') %}
94 <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
95 {%- endif %}
96 {%- if next %}
97 <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
98 {%- endif %}
99 {%- if prev %}
100 <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
101 {%- endif %}
102 {%- endblock %}
103 {%- block extrahead %} {% endblock %}
104 </head>
105
106 <body class="wy-body-for-nav">
107
108 {%- block extrabody %} {% endblock %}
109 <div class="wy-grid-for-nav">
110 {#- SIDE NAV, TOGGLES ON MOBILE #}
111 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
112 <div class="wy-side-scroll">
113 <div class="wy-side-nav-search" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
114 {%- block sidebartitle %}
115
116 {# the logo helper function was removed in Sphinx 6 and deprecated since Sphinx 4 #}
117 {# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #}
118 {%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
119 {%- set _root_doc = root_doc|default(master_doc) %}
120 <a href="{{ pathto(_root_doc) }}"{% if not theme_logo_only %} class="icon icon-home"{% endif %}>
121 {% if not theme_logo_only %}{{ project }}{% endif %}
122 {%- if logo or logo_url %}
123 <img src="{{ _logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
124 {%- endif %}
125 </a>
126
127 {%- if READTHEDOCS or DEBUG %}
128 {%- if theme_version_selector or theme_language_selector %}
129 <div class="switch-menus">
130 <div class="version-switch"></div>
131 <div class="language-switch"></div>
132 </div>
133 {%- endif %}
134 {%- endif %}
135
136 {%- include "searchbox.html" %}
137
138 {%- endblock %}
139 </div>
140
141 {%- block navigation %}
142 {#- Translators: This is an ARIA section label for the main navigation menu -#}
143 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Navigation menu') }}">
144 {%- block menu %}
145 {%- set toctree = toctree(maxdepth=theme_navigation_depth|int,
146 collapse=theme_collapse_navigation|tobool,
147 includehidden=theme_includehidden|tobool,
148 titles_only=theme_titles_only|tobool) %}
149 {%- if toctree %}
150 {{ toctree }}
151 {%- else %}
152 <!-- Local TOC -->
153 <div class="local-toc">{{ toc }}</div>
154 {%- endif %}
155 {%- endblock %}
156 </div>
157 {%- endblock %}
158 </div>
159 </nav>
160
161 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
162
163 {#- MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
164 {#- Translators: This is an ARIA section label for the navigation menu that is visible when viewing the page on mobile devices -#}
165 <nav class="wy-nav-top" aria-label="{{ _('Mobile navigation menu') }}" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
166 {%- block mobile_nav %}
167 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
168 <a href="{{ pathto(master_doc) }}">{{ project }}</a>
169 {%- endblock %}
170 </nav>
171
172 <div class="wy-nav-content">
173 {%- block content %}
174 {%- if theme_style_external_links|tobool %}
175 <div class="rst-content style-external-links">
176 {%- else %}
177 <div class="rst-content">
178 {%- endif %}
179 {% include "breadcrumbs.html" %}
180 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
181 {%- block document %}
182 <div itemprop="articleBody">
183 {% block body %}{% endblock %}
184 </div>
185 {%- if self.comments()|trim %}
186 <div class="articleComments">
187 {%- block comments %}{% endblock %}
188 </div>
189 {%- endif%}
190 </div>
191 {%- endblock %}
192 {% include "footer.html" %}
193 </div>
194 {%- endblock %}
195 </div>
196 </section>
197 </div>
198 {% include "versions.html" -%}
199
200 <script>
201 jQuery(function () {
202 SphinxRtdTheme.Navigation.enable({{ 'true' if theme_sticky_navigation|tobool else 'false' }});
203 });
204 </script>
205
206 {#- Do not conflict with RTD insertion of analytics script #}
207 {%- if not READTHEDOCS %}
208 {%- if theme_analytics_id %}
209 <!-- Theme Analytics -->
210 <script async src="https://www.googletagmanager.com/gtag/js?id={{ theme_analytics_id }}"></script>
211 <script>
212 window.dataLayer = window.dataLayer || [];
213 function gtag(){dataLayer.push(arguments);}
214 gtag('js', new Date());
215
216 gtag('config', '{{ theme_analytics_id }}', {
217 'anonymize_ip': {{ 'true' if theme_analytics_anonymize_ip|tobool else 'false' }},
218 });
219 </script>
220
221 {%- endif %}
222 {%- endif %}
223
224 {%- block footer %} {% endblock %}
225
226 </body>
227 </html>