1
0

index.hbs 15 KB

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