Debian Codegraph @

book/theme/index.hbs

raw
1 <!DOCTYPE HTML>
2 <html lang="{{ language }}" class="{{ default_theme }} sidebar-visible" dir="{{ text_direction }}">
3 <head>
4 <!-- Book generated using mdBook -->
5 <meta charset="UTF-8">
6 <title>{{ title }}</title>
7 {{#if is_print }}
8 <meta name="robots" content="noindex">
9 {{/if}}
10 {{#if base_url}}
11 <base href="{{ base_url }}">
12 {{/if}}
13
14
15 <!-- Custom HTML head -->
16 {{> head}}
17
18 <meta name="description" content="{{ description }}">
19 <meta name="viewport" content="width=device-width, initial-scale=1">
20 <meta name="theme-color" content="#ffffff">
21
22 {{#if favicon_svg}}
23 <link rel="icon" href="{{ resource "favicon.svg" }}">
24 {{/if}}
25 {{#if favicon_png}}
26 <link rel="shortcut icon" href="{{ resource "favicon.png" }}">
27 {{/if}}
28 <link rel="stylesheet" href="{{ resource "css/variables.css" }}">
29 <link rel="stylesheet" href="{{ resource "css/general.css" }}">
30 <link rel="stylesheet" href="{{ resource "css/chrome.css" }}">
31 {{#if print_enable}}
32 <link rel="stylesheet" href="{{ resource "css/print.css" }}" media="print">
33 {{/if}}
34
35 <!-- Fonts -->
36 <link rel="stylesheet" href="{{ resource "fonts/fonts.css" }}">
37
38 <!-- Highlight.js Stylesheets -->
39 <link rel="stylesheet" id="mdbook-highlight-css" href="{{ resource "highlight.css" }}">
40 <link rel="stylesheet" id="mdbook-tomorrow-night-css" href="{{ resource "tomorrow-night.css" }}">
41 <link rel="stylesheet" id="mdbook-ayu-highlight-css" href="{{ resource "ayu-highlight.css" }}">
42
43 <!-- Custom theme stylesheets -->
44 {{#each additional_css}}
45 <link rel="stylesheet" href="{{ resource this }}">
46 {{/each}}
47
48 {{#if mathjax_support}}
49 <!-- MathJax -->
50 <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
51 {{/if}}
52
53 <!-- Provide site root and default themes to javascript -->
54 <script>
55 const path_to_root = "{{ path_to_root }}";
56 const default_light_theme = "{{ default_theme }}";
57 const default_dark_theme = "{{ preferred_dark_theme }}";
58 {{#if search_js}}
59 window.path_to_searchindex_js = "{{ resource "searchindex.js" }}";
60 {{/if}}
61 </script>
62 <!-- Start loading toc.js asap -->
63 <script src="{{ resource "toc.js" }}"></script>
64 </head>
65 <body>
66 <div id="mdbook-help-container">
67 <div id="mdbook-help-popup">
68 <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
69 <div>
70 <p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
71 {{#if search_enabled}}
72 <p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
73 {{/if}}
74 <p>Press <kbd>?</kbd> to show this help</p>
75 <p>Press <kbd>Esc</kbd> to hide this help</p>
76 </div>
77 </div>
78 </div>
79 <div id="mdbook-body-container">
80 <!-- Work around some values being stored in localStorage wrapped in quotes -->
81 <script>
82 try {
83 let theme = localStorage.getItem('mdbook-theme');
84 let sidebar = localStorage.getItem('mdbook-sidebar');
85
86 if (theme.startsWith('"') && theme.endsWith('"')) {
87 localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
88 }
89
90 if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
91 localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
92 }
93 } catch (e) { }
94 </script>
95
96 <!-- Set the theme before any content is loaded, prevents flash -->
97 <script>
98 const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
99 let theme;
100 try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
101 if (theme === null || theme === undefined) { theme = default_theme; }
102 const html = document.documentElement;
103 html.classList.remove('{{ default_theme }}')
104 html.classList.add(theme);
105 html.classList.add("js");
106 </script>
107
108 <input type="checkbox" id="mdbook-sidebar-toggle-anchor" class="hidden">
109
110 <!-- Hide / unhide sidebar before it is displayed -->
111 <script>
112 let sidebar = null;
113 const sidebar_toggle = document.getElementById("mdbook-sidebar-toggle-anchor");
114 if (document.body.clientWidth >= 1080) {
115 try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
116 sidebar = sidebar || 'visible';
117 } else {
118 sidebar = 'hidden';
119 sidebar_toggle.checked = false;
120 }
121 if (sidebar === 'visible') {
122 sidebar_toggle.checked = true;
123 } else {
124 html.classList.remove('sidebar-visible');
125 }
126 </script>
127
128 <nav id="mdbook-sidebar" class="sidebar" aria-label="Table of contents">
129 <!-- populated by js -->
130 <mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
131 <noscript>
132 <iframe class="sidebar-iframe-outer" src="{{ path_to_root }}toc.html"></iframe>
133 </noscript>
134 <div id="mdbook-sidebar-resize-handle" class="sidebar-resize-handle">
135 <div class="sidebar-resize-indicator"></div>
136 </div>
137 </nav>
138
139 <div id="mdbook-page-wrapper" class="page-wrapper">
140
141 <div class="page">
142 {{> header}}
143 <div id="mdbook-menu-bar-hover-placeholder"></div>
144 <div id="mdbook-menu-bar" class="menu-bar sticky">
145 <div class="left-buttons">
146 <label id="mdbook-sidebar-toggle" class="icon-button" for="mdbook-sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="mdbook-sidebar">
147 {{fa "solid" "bars"}}
148 </label>
149 <button id="mdbook-theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="mdbook-theme-list">
150 {{fa "solid" "paintbrush"}}
151 </button>
152 <ul id="mdbook-theme-list" class="theme-popup" aria-label="Themes" role="menu">
153 <li role="none"><button role="menuitem" class="theme" id="mdbook-theme-default_theme">Auto</button></li>
154 <li role="none"><button role="menuitem" class="theme" id="mdbook-theme-light">Light</button></li>
155 <li role="none"><button role="menuitem" class="theme" id="mdbook-theme-rust">Rust</button></li>
156 <li role="none"><button role="menuitem" class="theme" id="mdbook-theme-coal">Coal</button></li>
157 <li role="none"><button role="menuitem" class="theme" id="mdbook-theme-navy">Navy</button></li>
158 <li role="none"><button role="menuitem" class="theme" id="mdbook-theme-ayu">Ayu</button></li>
159 <li role="none"><button role="menuitem" class="theme" id="mdbook-theme-colibri">Colibri</button></li>
160 </ul>
161 {{#if search_enabled}}
162 <button id="mdbook-search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="mdbook-searchbar">
163 {{fa "solid" "magnifying-glass"}}
164 </button>
165 {{/if}}
166 </div>
167
168 <h1 class="menu-title">{{ book_title }}</h1>
169
170 <div class="right-buttons">
171 {{#if print_enable}}
172 <a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
173 {{fa "solid" "print" "print-button"}}
174 </a>
175 {{/if}}
176 {{#if git_repository_url}}
177 <a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
178 {{fa git_repository_icon_class git_repository_icon}}
179 </a>
180 {{/if}}
181 {{#if git_repository_edit_url}}
182 <a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit" rel="edit">
183 {{fa "solid" "pencil" "git-edit-button"}}
184 </a>
185 {{/if}}
186
187 </div>
188 </div>
189
190 {{#if search_enabled}}
191 <div id="mdbook-search-wrapper" class="hidden">
192 <form id="mdbook-searchbar-outer" class="searchbar-outer">
193 <div class="search-wrapper">
194 <input type="search" id="mdbook-searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="mdbook-searchresults-outer" aria-describedby="searchresults-header">
195 <div class="spinner-wrapper">
196 {{fa "solid" "spinner" "fa-spin"}}
197 </div>
198 </div>
199 </form>
200 <div id="mdbook-searchresults-outer" class="searchresults-outer hidden">
201 <div id="mdbook-searchresults-header" class="searchresults-header"></div>
202 <ul id="mdbook-searchresults">
203 </ul>
204 </div>
205 </div>
206 {{/if}}
207
208 <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
209 <script>
210 document.getElementById('mdbook-sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
211 document.getElementById('mdbook-sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
212 Array.from(document.querySelectorAll('#mdbook-sidebar a')).forEach(function(link) {
213 link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
214 });
215 </script>
216
217 <div id="mdbook-content" class="content">
218 <main>
219 {{{ content }}}
220 </main>
221
222 <nav class="nav-wrapper" aria-label="Page navigation">
223 <!-- Mobile navigation buttons -->
224 {{#if previous}}
225 <a rel="prev" href="{{ path_to_root }}{{previous.link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
226 {{#if (eq ../text_direction "rtl")}}
227 {{fa "solid" "angle-right"}}
228 {{else}}
229 {{fa "solid" "angle-left"}}
230 {{/if}}
231 </a>
232 {{/if}}
233
234 {{#if next}}
235 <a rel="next prefetch" href="{{ path_to_root }}{{next.link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
236 {{#if (eq ../text_direction "rtl")}}
237 {{fa "solid" "angle-left"}}
238 {{else}}
239 {{fa "solid" "angle-right"}}
240 {{/if}}
241 </a>
242 {{/if}}
243
244 <div style="clear: both"></div>
245 </nav>
246 </div>
247 </div>
248
249 <nav class="nav-wide-wrapper" aria-label="Page navigation">
250 {{#if previous}}
251 <a rel="prev" href="{{ path_to_root }}{{previous.link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
252 {{#if (eq ../text_direction "rtl")}}
253 {{fa "solid" "angle-right"}}
254 {{else}}
255 {{fa "solid" "angle-left"}}
256 {{/if}}
257 </a>
258 {{/if}}
259
260 {{#if next}}
261 <a rel="next prefetch" href="{{ path_to_root }}{{next.link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
262 {{#if (eq text_direction "rtl")}}
263 {{fa "solid" "angle-left"}}
264 {{else}}
265 {{fa "solid" "angle-right"}}
266 {{/if}}
267 </a>
268 {{/if}}
269 </nav>
270
271 </div>
272
273 <template id=fa-eye>{{fa "solid" "eye"}}</template>
274 <template id=fa-eye-slash>{{fa "solid" "eye-slash"}}</template>
275 <template id=fa-copy>{{fa "regular" "copy"}}</template>
276 <template id=fa-play>{{fa "solid" "play"}}</template>
277 <template id=fa-clock-rotate-left>{{fa "solid" "clock-rotate-left"}}</template>
278
279 {{#if live_reload_endpoint}}
280 <!-- Livereload script (if served using the cli tool) -->
281 <script>
282 const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
283 const wsAddress = wsProtocol + "//" + location.host + "/" + "{{{live_reload_endpoint}}}";
284 const socket = new WebSocket(wsAddress);
285 socket.onmessage = function (event) {
286 if (event.data === "reload") {
287 socket.close();
288 location.reload();
289 }
290 };
291
292 window.onbeforeunload = function() {
293 socket.close();
294 }
295 </script>
296 {{/if}}
297
298 {{#if playground_line_numbers}}
299 <script>
300 window.playground_line_numbers = true;
301 </script>
302 {{/if}}
303
304 {{#if playground_copyable}}
305 <script>
306 window.playground_copyable = true;
307 </script>
308 {{/if}}
309
310 {{#if playground_js}}
311 <script src="{{ resource "ace.js" }}"></script>
312 <script src="{{ resource "mode-rust.js" }}"></script>
313 <script src="{{ resource "editor.js" }}"></script>
314 <script src="{{ resource "theme-dawn.js" }}"></script>
315 <script src="{{ resource "theme-tomorrow_night.js" }}"></script>
316 {{/if}}
317
318 {{#if search_js}}
319 <script src="{{ resource "elasticlunr.min.js" }}"></script>
320 <script src="{{ resource "mark.min.js" }}"></script>
321 <script src="{{ resource "searcher.js" }}"></script>
322 {{/if}}
323
324 <script src="{{ resource "clipboard.min.js" }}"></script>
325 <script src="{{ resource "highlight.js" }}"></script>
326
327 <!-- Custom JS scripts -->
328 {{#each additional_js}}
329 <script src="{{ resource this}}"></script>
330 {{/each}}
331
332 <script src="{{ resource "book.js" }}"></script>
333
334 {{#if is_print}}
335 {{#if mathjax_support}}
336 <script>
337 window.addEventListener('load', function() {
338 MathJax.Hub.Register.StartupHook('End', function() {
339 window.setTimeout(window.print, 100);
340 });
341 });
342 </script>
343 {{else}}
344 <script>
345 window.addEventListener('load', function() {
346 window.setTimeout(window.print, 100);
347 });
348 </script>
349 {{/if}}
350 {{/if}}
351
352 {{#if fragment_map}}
353 <script>
354 document.addEventListener('DOMContentLoaded', function() {
355 const fragmentMap =
356 {{{fragment_map}}}
357 ;
358 const target = fragmentMap[window.location.hash];
359 if (target) {
360 let url = new URL(target, window.location.href);
361 window.location.replace(url.href);
362 }
363 });
364 </script>
365 {{/if}}
366
367 </div>
368 </body>
369 </html>