fork/numbat

git clone https://git.julia.blue/fork/numbat

David PeterDoc improvements, syntax highlighing in docsb80c4ea

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