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