index.hbs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <!DOCTYPE HTML>
  2. <html lang="{{ language }}" class="sidebar-visible no-js {{ default_theme }}">
  3. <head>
  4. <!-- Book generated using mdBook -->
  5. <meta charset="UTF-8">
  6. <title>{{ book_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. <!-- Custom HTML head -->
  14. {{> head}}
  15. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  16. <meta name="description" content="{{ description }}">
  17. <meta name="viewport" content="width=device-width, initial-scale=1">
  18. <meta name="theme-color" content="#ffffff" />
  19. {{#if favicon_svg}}
  20. <link rel="icon" href="{{ path_to_root }}favicon.svg">
  21. {{/if}}
  22. {{#if favicon_png}}
  23. <link rel="shortcut icon" href="{{ path_to_root }}favicon.png">
  24. {{/if}}
  25. <link rel="stylesheet" href="{{ path_to_root }}css/variables.css">
  26. <link rel="stylesheet" href="{{ path_to_root }}css/general.css">
  27. <link rel="stylesheet" href="{{ path_to_root }}css/chrome.css">
  28. <link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
  29. <!-- Fonts -->
  30. <link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
  31. {{#if copy_fonts}}
  32. <link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
  33. {{/if}}
  34. <!-- Highlight.js Stylesheets -->
  35. <link rel="stylesheet" href="{{ path_to_root }}highlight.css">
  36. <link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css">
  37. <link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css">
  38. <!-- Custom theme stylesheets -->
  39. {{#each additional_css}}
  40. <link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
  41. {{/each}}
  42. {{#if mathjax_support}}
  43. <!-- MathJax -->
  44. <script async type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  45. {{/if}}
  46. </head>
  47. <body>
  48. <!-- Provide site root to javascript -->
  49. <script type="text/javascript">
  50. var path_to_root = "{{ path_to_root }}";
  51. var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
  52. </script>
  53. <!-- Work around some values being stored in localStorage wrapped in quotes -->
  54. <script type="text/javascript">
  55. try {
  56. var theme = localStorage.getItem('mdbook-theme');
  57. var sidebar = localStorage.getItem('mdbook-sidebar');
  58. if (theme.startsWith('"') && theme.endsWith('"')) {
  59. localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
  60. }
  61. if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
  62. localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
  63. }
  64. } catch (e) { }
  65. </script>
  66. <!-- Set the theme before any content is loaded, prevents flash -->
  67. <script type="text/javascript">
  68. var theme;
  69. try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
  70. if (theme === null || theme === undefined) { theme = default_theme; }
  71. var html = document.querySelector('html');
  72. html.classList.remove('no-js')
  73. html.classList.remove('{{ default_theme }}')
  74. html.classList.add(theme);
  75. html.classList.add('js');
  76. </script>
  77. <!-- Hide / unhide sidebar before it is displayed -->
  78. <script type="text/javascript">
  79. var html = document.querySelector('html');
  80. var sidebar = 'hidden';
  81. if (document.body.clientWidth >= 1080) {
  82. try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
  83. sidebar = sidebar || 'visible';
  84. }
  85. html.classList.remove('sidebar-visible');
  86. html.classList.add("sidebar-" + sidebar);
  87. </script>
  88. <nav id="sidebar" class="sidebar" aria-label="Table of contents">
  89. <div class="sidebar-scrollbox">
  90. {{#toc}}{{/toc}}
  91. </div>
  92. <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
  93. </nav>
  94. <div id="page-wrapper" class="page-wrapper">
  95. <div class="page">
  96. {{> header}}
  97. <div id="menu-bar-hover-placeholder"></div>
  98. <div id="menu-bar" class="menu-bar sticky bordered">
  99. <div class="left-buttons">
  100. <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
  101. <i class="fa fa-bars"></i>
  102. </button>
  103. <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">
  104. <i class="fa fa-paint-brush"></i>
  105. </button>
  106. <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
  107. <li role="none"><button role="menuitem" class="theme" id="light">{{ theme_option "Light" }}</button></li>
  108. <li role="none"><button role="menuitem" class="theme" id="rust">{{ theme_option "Rust" }}</button></li>
  109. <li role="none"><button role="menuitem" class="theme" id="coal">{{ theme_option "Coal" }}</button></li>
  110. <li role="none"><button role="menuitem" class="theme" id="navy">{{ theme_option "Navy" }}</button></li>
  111. <li role="none"><button role="menuitem" class="theme" id="ayu">{{ theme_option "Ayu" }}</button></li>
  112. </ul>
  113. {{#if search_enabled}}
  114. <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
  115. <i class="fa fa-search"></i>
  116. </button>
  117. {{/if}}
  118. </div>
  119. <!-- Make the book title only appear if it is *not* the chapter title as well -->
  120. <h1 id="book-title" class="menu-title">{{ book_title }}</h1>
  121. <script type="text/javascript">
  122. var bookTitleElement = document.getElementById('book-title')
  123. var bookTitle = '{{ book_title }}';
  124. var chapterTitle = '{{ chapter_title }}';
  125. if (bookTitle === chapterTitle) {
  126. bookTitleElement.innerText = null;
  127. document.title = bookTitle;
  128. }
  129. </script>
  130. <div class="right-buttons">
  131. <a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
  132. <i id="print-button" class="fa fa-print"></i>
  133. </a>
  134. {{#if git_repository_url}}
  135. <a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
  136. <i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
  137. </a>
  138. {{/if}}
  139. </div>
  140. </div>
  141. {{#if search_enabled}}
  142. <div id="search-wrapper" class="hidden">
  143. <form id="searchbar-outer" class="searchbar-outer">
  144. <input type="search" name="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
  145. </form>
  146. <div id="searchresults-outer" class="searchresults-outer hidden">
  147. <div id="searchresults-header" class="searchresults-header"></div>
  148. <ul id="searchresults">
  149. </ul>
  150. </div>
  151. </div>
  152. {{/if}}
  153. <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
  154. <script type="text/javascript">
  155. document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
  156. document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
  157. Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
  158. link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
  159. });
  160. </script>
  161. <div id="content" class="content">
  162. <main>
  163. {{{ content }}}
  164. </main>
  165. <nav class="nav-wrapper" aria-label="Page navigation">
  166. <!-- Mobile navigation buttons -->
  167. {{#previous}}
  168. <a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  169. <i class="fa fa-angle-left"></i>
  170. </a>
  171. {{/previous}}
  172. {{#next}}
  173. <a rel="next" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  174. <i class="fa fa-angle-right"></i>
  175. </a>
  176. {{/next}}
  177. <div style="clear: both"></div>
  178. </nav>
  179. </div>
  180. </div>
  181. <nav class="nav-wide-wrapper" aria-label="Page navigation">
  182. {{#previous}}
  183. <a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  184. <i class="fa fa-angle-left"></i>
  185. </a>
  186. {{/previous}}
  187. {{#next}}
  188. <a rel="next" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  189. <i class="fa fa-angle-right"></i>
  190. </a>
  191. {{/next}}
  192. </nav>
  193. </div>
  194. {{#if livereload}}
  195. <!-- Livereload script (if served using the cli tool) -->
  196. <script type="text/javascript">
  197. var socket = new WebSocket("{{{livereload}}}");
  198. socket.onmessage = function (event) {
  199. if (event.data === "reload") {
  200. socket.close();
  201. location.reload();
  202. }
  203. };
  204. window.onbeforeunload = function() {
  205. socket.close();
  206. }
  207. </script>
  208. {{/if}}
  209. {{#if playground_line_numbers}}
  210. <script type="text/javascript">
  211. window.playground_line_numbers = true;
  212. </script>
  213. {{/if}}
  214. {{#if playground_copyable}}
  215. <script type="text/javascript">
  216. window.playground_copyable = true;
  217. </script>
  218. {{/if}}
  219. {{#if playground_js}}
  220. <script src="{{ path_to_root }}ace.js" type="text/javascript" charset="utf-8"></script>
  221. <script src="{{ path_to_root }}editor.js" type="text/javascript" charset="utf-8"></script>
  222. <script src="{{ path_to_root }}mode-rust.js" type="text/javascript" charset="utf-8"></script>
  223. <script src="{{ path_to_root }}theme-dawn.js" type="text/javascript" charset="utf-8"></script>
  224. <script src="{{ path_to_root }}theme-tomorrow_night.js" type="text/javascript" charset="utf-8"></script>
  225. {{/if}}
  226. {{#if search_js}}
  227. <script src="{{ path_to_root }}elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
  228. <script src="{{ path_to_root }}mark.min.js" type="text/javascript" charset="utf-8"></script>
  229. <script src="{{ path_to_root }}searcher.js" type="text/javascript" charset="utf-8"></script>
  230. {{/if}}
  231. <script src="{{ path_to_root }}clipboard.min.js" type="text/javascript" charset="utf-8"></script>
  232. <script src="{{ path_to_root }}highlight.js" type="text/javascript" charset="utf-8"></script>
  233. <script src="{{ path_to_root }}book.js" type="text/javascript" charset="utf-8"></script>
  234. <!-- Custom JS scripts -->
  235. {{#each additional_js}}
  236. <script type="text/javascript" src="{{ ../path_to_root }}{{this}}"></script>
  237. {{/each}}
  238. {{#if is_print}}
  239. {{#if mathjax_support}}
  240. <script type="text/javascript">
  241. window.addEventListener('load', function() {
  242. MathJax.Hub.Register.StartupHook('End', function() {
  243. window.setTimeout(window.print, 100);
  244. });
  245. });
  246. </script>
  247. {{else}}
  248. <script type="text/javascript">
  249. window.addEventListener('load', function() {
  250. window.setTimeout(window.print, 100);
  251. });
  252. </script>
  253. {{/if}}
  254. {{/if}}
  255. </body>
  256. </html>