index.hbs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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="内容目录" 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="切换主题" 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="all">{{ theme_option "全部" }}</button></li>
  110. <li role="none"><button role="menuitem" class="theme" id="tai">{{ theme_option "傣" }}</button></li>
  111. <li role="none"><button role="menuitem" class="theme" id="roman">{{ theme_option "罗马" }}</button></li>
  112. <li role="none"><button role="menuitem" class="theme" id="han">{{ theme_option "汉字注音" }}</button></li>
  113. </ul>
  114. {{#if search_enabled}}
  115. <button id="search-toggle" class="icon-button" type="button" title="搜索 快捷键:S" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
  116. <i class="fa fa-search" ></i>
  117. </button>
  118. {{/if}}
  119. </div>
  120. <h1 class="menu-title">{{ book_title }}</h1>
  121. <div class="right-buttons">
  122. <a href="https://github.com/iapt-platform/pali-handbook" target="_blank"><i class="fa fa-github"></i></a>
  123. <a href="https://gitee.com/bhikkhu-kosalla/pali-handbook" target="_blank"></a>
  124. {{#if print_enable}}
  125. <a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
  126. <i id="print-button" class="fa fa-print"></i>
  127. </a>
  128. {{/if}}
  129. {{#if git_repository_url}}
  130. <a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
  131. <i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
  132. </a>
  133. {{/if}}
  134. {{#if git_repository_edit_url}}
  135. <a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
  136. <i id="git-edit-button" class="fa fa-edit"></i>
  137. </a>
  138. {{/if}}
  139. <a href="javascript:openQrcode()" ><i class="fa fa-qrcode" aria-hidden="true"></i></a>
  140. </div>
  141. </div>
  142. {{#if search_enabled}}
  143. <div id="search-wrapper" class="hidden">
  144. <form id="searchbar-outer" class="searchbar-outer">
  145. <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
  146. </form>
  147. <div id="searchresults-outer" class="searchresults-outer hidden">
  148. <div id="searchresults-header" class="searchresults-header"></div>
  149. <ul id="searchresults">
  150. </ul>
  151. </div>
  152. </div>
  153. {{/if}}
  154. <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
  155. <script type="text/javascript">
  156. document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
  157. document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
  158. Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
  159. link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
  160. });
  161. </script>
  162. <div id="content" class="content">
  163. <main>
  164. {{{ content }}}
  165. </main>
  166. <nav class="nav-wrapper" aria-label="Page navigation">
  167. <!-- Mobile navigation buttons -->
  168. {{#previous}}
  169. <a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  170. <i class="fa fa-angle-left"></i>
  171. </a>
  172. {{/previous}}
  173. {{#next}}
  174. <a rel="next" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  175. <i class="fa fa-angle-right"></i>
  176. </a>
  177. {{/next}}
  178. <div style="clear: both"></div>
  179. </nav>
  180. </div>
  181. </div>
  182. <nav class="nav-wide-wrapper" aria-label="Page navigation">
  183. {{#previous}}
  184. <a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  185. <i class="fa fa-angle-left"></i>
  186. </a>
  187. {{/previous}}
  188. {{#next}}
  189. <a rel="next" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  190. <i class="fa fa-angle-right"></i>
  191. </a>
  192. {{/next}}
  193. </nav>
  194. </div>
  195. {{#if livereload}}
  196. <!-- Livereload script (if served using the cli tool) -->
  197. <script type="text/javascript">
  198. var socket = new WebSocket("{{{livereload}}}");
  199. socket.onmessage = function (event) {
  200. if (event.data === "reload") {
  201. socket.close();
  202. location.reload();
  203. }
  204. };
  205. window.onbeforeunload = function() {
  206. socket.close();
  207. }
  208. </script>
  209. {{/if}}
  210. {{#if google_analytics}}
  211. <!-- Google Analytics Tag -->
  212. <script type="text/javascript">
  213. var localAddrs = ["localhost", "127.0.0.1", ""];
  214. // make sure we don't activate google analytics if the developer is
  215. // inspecting the book locally...
  216. if (localAddrs.indexOf(document.location.hostname) === -1) {
  217. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  218. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  219. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  220. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  221. ga('create', '{{google_analytics}}', 'auto');
  222. ga('send', 'pageview');
  223. }
  224. </script>
  225. {{/if}}
  226. {{#if playground_line_numbers}}
  227. <script type="text/javascript">
  228. window.playground_line_numbers = true;
  229. </script>
  230. {{/if}}
  231. {{#if playground_copyable}}
  232. <script type="text/javascript">
  233. window.playground_copyable = true;
  234. </script>
  235. {{/if}}
  236. {{#if playground_js}}
  237. <script src="{{ path_to_root }}ace.js" type="text/javascript" charset="utf-8"></script>
  238. <script src="{{ path_to_root }}editor.js" type="text/javascript" charset="utf-8"></script>
  239. <script src="{{ path_to_root }}mode-rust.js" type="text/javascript" charset="utf-8"></script>
  240. <script src="{{ path_to_root }}theme-dawn.js" type="text/javascript" charset="utf-8"></script>
  241. <script src="{{ path_to_root }}theme-tomorrow_night.js" type="text/javascript" charset="utf-8"></script>
  242. {{/if}}
  243. {{#if search_js}}
  244. <script src="{{ path_to_root }}elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
  245. <script src="{{ path_to_root }}mark.min.js" type="text/javascript" charset="utf-8"></script>
  246. <script src="{{ path_to_root }}searcher.js" type="text/javascript" charset="utf-8"></script>
  247. {{/if}}
  248. <script src="{{ path_to_root }}clipboard.min.js" type="text/javascript" charset="utf-8"></script>
  249. <script src="{{ path_to_root }}highlight.js" type="text/javascript" charset="utf-8"></script>
  250. <script src="{{ path_to_root }}book.js" type="text/javascript" charset="utf-8"></script>
  251. <!-- Custom JS scripts -->
  252. {{#each additional_js}}
  253. <script type="text/javascript" src="{{ ../path_to_root }}{{this}}"></script>
  254. {{/each}}
  255. {{#if is_print}}
  256. {{#if mathjax_support}}
  257. <script type="text/javascript">
  258. window.addEventListener('load', function() {
  259. MathJax.Hub.Register.StartupHook('End', function() {
  260. window.setTimeout(window.print, 100);
  261. });
  262. });
  263. </script>
  264. {{else}}
  265. <script type="text/javascript">
  266. window.addEventListener('load', function() {
  267. window.setTimeout(window.print, 100);
  268. });
  269. </script>
  270. {{/if}}
  271. {{/if}}
  272. <div id="qrcode" style="margin:1rem"></div>
  273. <script>
  274. new QRCode($('#qrcode')[0], location.href); // 设置要生成二维码的链接
  275. function openQrcode(){
  276. layer.open({
  277. type: 1,
  278. title: false,
  279. content: $('#qrcode') //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响
  280. });
  281. }
  282. </script>
  283. </body>
  284. </html>