index.hbs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <!DOCTYPE HTML>
  2. <html lang="{{ language }}" class="{{ default_theme }}" 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. <!-- 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="#e23229">
  19. <meta property="og:title" content="{{ title }}"/>
  20. <meta property="og:description" content="{{ description }}"/>
  21. <meta property="og:type" content="website"/>
  22. <meta property="og:image" content="{{ path_to_root }}favicon.png">
  23. <link rel="shortcut icon" href="{{ path_to_root }}favicon.png">
  24. <link rel="stylesheet" href="{{ path_to_root }}css/variables.css">
  25. <link rel="stylesheet" href="{{ path_to_root }}css/general.css">
  26. <link rel="stylesheet" href="{{ path_to_root }}css/chrome.css">
  27. {{#if print_enable}}
  28. <link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
  29. {{/if}}
  30. <!-- Fonts -->
  31. <link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
  32. {{#if copy_fonts}}
  33. <link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
  34. {{/if}}
  35. <!-- Highlight.js Stylesheets -->
  36. <link rel="stylesheet" href="{{ path_to_root }}highlight.css">
  37. <link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css">
  38. <link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css">
  39. <!-- Custom theme stylesheets -->
  40. {{#each additional_css}}
  41. <link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
  42. {{/each}}
  43. {{#if mathjax_support}}
  44. <!-- MathJax -->
  45. <script async type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  46. {{/if}}
  47. </head>
  48. <body class="sidebar-visible no-js">
  49. <!-- Provide site root to javascript -->
  50. <script type="text/javascript">
  51. var path_to_root = "{{ path_to_root }}";
  52. var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
  53. </script>
  54. <!-- Work around some values being stored in localStorage wrapped in quotes -->
  55. <script type="text/javascript">
  56. try {
  57. var theme = localStorage.getItem('mdbook-theme');
  58. var sidebar = localStorage.getItem('mdbook-sidebar');
  59. if (theme.startsWith('"') && theme.endsWith('"')) {
  60. localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
  61. }
  62. if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
  63. localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
  64. }
  65. } catch (e) { }
  66. </script>
  67. <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
  68. <!-- Hide / unhide sidebar before it is displayed -->
  69. <script type="text/javascript">
  70. var body = document.querySelector('body');
  71. var sidebar = 'hidden';
  72. var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
  73. if (document.body.clientWidth >= 1080) {
  74. try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
  75. sidebar = sidebar || 'visible';
  76. }
  77. sidebar_toggle.checked = sidebar === 'visible';
  78. body.classList.remove('sidebar-visible');
  79. body.classList.add("sidebar-" + sidebar);
  80. </script>
  81. <nav id="sidebar" class="sidebar" aria-label="Table of contents">
  82. <div class="sidebar-scrollbox">
  83. {{#toc}}{{/toc}}
  84. </div>
  85. <div id="sidebar-resize-handle" class="sidebar-resize-handle">
  86. <div class="sidebar-resize-indicator"></div>
  87. </div>
  88. </nav>
  89. <div id="page-wrapper" class="page-wrapper">
  90. <div class="page">
  91. {{> header}}
  92. <div id="menu-bar-hover-placeholder"></div>
  93. <div id="menu-bar" class="menu-bar sticky bordered">
  94. <div class="left-buttons">
  95. <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">
  96. <i class="fa fa-bars"></i>
  97. </label>
  98. <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">
  99. <i class="fa fa-paint-brush"></i>
  100. </button>
  101. <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
  102. <li role="none"><button role="menuitem" class="theme" id="light">{{ theme_option "Light" }}</button></li>
  103. <li role="none"><button role="menuitem" class="theme" id="rust">{{ theme_option "Rust" }}</button></li>
  104. <li role="none"><button role="menuitem" class="theme" id="coal">{{ theme_option "Coal" }}</button></li>
  105. <li role="none"><button role="menuitem" class="theme" id="navy">{{ theme_option "Navy" }}</button></li>
  106. <li role="none"><button role="menuitem" class="theme" id="ayu">{{ theme_option "Ayu" }}</button></li>
  107. </ul>
  108. {{#if search_enabled}}
  109. <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">
  110. <i class="fa fa-search"></i>
  111. </button>
  112. {{/if}}
  113. </div>
  114. <h1 class="menu-title">{{ book_title }}</h1>
  115. <div class="right-buttons">
  116. {{#if print_enable}}
  117. <a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
  118. <i id="print-button" class="fa fa-print"></i>
  119. </a>
  120. {{/if}}
  121. {{#if git_repository_url}}
  122. <a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
  123. <i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
  124. </a>
  125. {{/if}}
  126. {{#if git_repository_edit_url}}
  127. <a href="{{git_repository_edit_url}}" title="View & edit page on GitHub" aria-label="View & edit page on GitHub">
  128. <i id="git-edit-button" class="fa fa-edit"></i>
  129. </a>
  130. {{/if}}
  131. </div>
  132. </div>
  133. {{#if search_enabled}}
  134. <div id="search-wrapper" class="hidden">
  135. <form id="searchbar-outer" class="searchbar-outer">
  136. <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
  137. </form>
  138. <div id="searchresults-outer" class="searchresults-outer hidden">
  139. <div id="searchresults-header" class="searchresults-header"></div>
  140. <ul id="searchresults">
  141. </ul>
  142. </div>
  143. </div>
  144. {{/if}}
  145. <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
  146. <script type="text/javascript">
  147. document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
  148. document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
  149. Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
  150. link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
  151. });
  152. </script>
  153. <div id="content" class="content">
  154. <main>
  155. <!-- Page table of contents -->
  156. <div class="sidetoc"><nav class="pagetoc"></nav></div>
  157. {{{ content }}}
  158. </main>
  159. <!-- <nav class="nav-wrapper" aria-label="Page navigation">
  160. Mobile navigation buttons
  161. {{#previous}}
  162. <a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  163. <i class="fa fa-angle-left"></i>
  164. </a>
  165. {{/previous}}
  166. {{#next}}
  167. <a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  168. <i class="fa fa-angle-right"></i>
  169. </a>
  170. {{/next}}
  171. <div style="clear: both"></div>
  172. </nav> -->
  173. <footer id="subpage-footer">
  174. <p>Subpages</p>
  175. </footer>
  176. </div>
  177. </div>
  178. <!--<nav class="nav-wide-wrapper" aria-label="Page navigation">
  179. {{#previous}}
  180. <a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  181. <i class="fa fa-angle-left"></i>
  182. </a>
  183. {{/previous}}
  184. {{#next}}
  185. <a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  186. <i class="fa fa-angle-right"></i>
  187. </a>
  188. {{/next}}
  189. </nav>-->
  190. </div>
  191. {{#if livereload}}
  192. <!-- Livereload script (if served using the cli tool) -->
  193. <script type="text/javascript">
  194. var socket = new WebSocket("{{{livereload}}}");
  195. socket.onmessage = function (event) {
  196. if (event.data === "reload") {
  197. socket.close();
  198. location.reload();
  199. }
  200. };
  201. window.onbeforeunload = function() {
  202. socket.close();
  203. }
  204. </script>
  205. {{/if}}
  206. {{#if google_analytics}}
  207. <!-- Google Analytics Tag -->
  208. <script type="text/javascript">
  209. var localAddrs = ["localhost", "127.0.0.1", ""];
  210. // make sure we don't activate google analytics if the developer is
  211. // inspecting the book locally...
  212. if (localAddrs.indexOf(document.location.hostname) === -1) {
  213. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  214. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  215. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  216. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  217. ga('create', '{{google_analytics}}', 'auto');
  218. ga('send', 'pageview');
  219. }
  220. </script>
  221. {{/if}}
  222. {{#if playground_line_numbers}}
  223. <script type="text/javascript">
  224. window.playground_line_numbers = true;
  225. </script>
  226. {{/if}}
  227. {{#if playground_copyable}}
  228. <script type="text/javascript">
  229. window.playground_copyable = true;
  230. </script>
  231. {{/if}}
  232. {{#if playground_js}}
  233. <script src="{{ path_to_root }}ace.js" type="text/javascript" charset="utf-8"></script>
  234. <script src="{{ path_to_root }}editor.js" type="text/javascript" charset="utf-8"></script>
  235. <script src="{{ path_to_root }}mode-rust.js" type="text/javascript" charset="utf-8"></script>
  236. <script src="{{ path_to_root }}theme-dawn.js" type="text/javascript" charset="utf-8"></script>
  237. <script src="{{ path_to_root }}theme-tomorrow_night.js" type="text/javascript" charset="utf-8"></script>
  238. {{/if}}
  239. {{#if search_js}}
  240. <script src="{{ path_to_root }}elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
  241. <script src="{{ path_to_root }}mark.min.js" type="text/javascript" charset="utf-8"></script>
  242. <script src="{{ path_to_root }}searcher.js" type="text/javascript" charset="utf-8"></script>
  243. {{/if}}
  244. <script src="{{ path_to_root }}clipboard.min.js" type="text/javascript" charset="utf-8"></script>
  245. <script src="{{ path_to_root }}highlight.js" type="text/javascript" charset="utf-8"></script>
  246. <script src="{{ path_to_root }}book.js" type="text/javascript" charset="utf-8"></script>
  247. <!-- Custom JS scripts -->
  248. {{#each additional_js}}
  249. <script type="text/javascript" src="{{ ../path_to_root }}{{this}}"></script>
  250. {{/each}}
  251. {{#if is_print}}
  252. {{#if mathjax_support}}
  253. <script type="text/javascript">
  254. window.addEventListener('load', function() {
  255. MathJax.Hub.Register.StartupHook('End', function() {
  256. window.setTimeout(window.print, 100);
  257. });
  258. });
  259. </script>
  260. {{else}}
  261. <script type="text/javascript">
  262. window.addEventListener('load', function() {
  263. window.setTimeout(window.print, 100);
  264. });
  265. </script>
  266. {{/if}}
  267. {{/if}}
  268. <!-- Set the theme before any content is loaded, prevents flash -->
  269. <script type="text/javascript">
  270. var theme;
  271. try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
  272. if (theme === null || theme === undefined) { theme = default_theme; }
  273. var html = document.querySelector('html');
  274. html.classList.remove('{{ default_theme }}')
  275. html.classList.add(theme);
  276. var body = document.querySelector('body');
  277. body.classList.remove('no-js')
  278. body.classList.add('js');
  279. </script>
  280. </body>
  281. </html>