1<!DOCTYPE HTML>
2<html lang="{{ language }}" data-theme="{{ default_theme }}" data-color-scheme="{{ 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
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 <link rel="shortcut icon" href="{{ path_to_root }}favicon.png">
23 <link rel="stylesheet" href="{{ path_to_root }}css/variables.css">
24 <link rel="stylesheet" href="{{ path_to_root }}css/general.css">
25 <link rel="stylesheet" href="{{ path_to_root }}css/chrome.css">
26 {{#if print_enable}}
27 <link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
28 {{/if}}
29
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
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
41 <!-- Custom theme stylesheets -->
42 {{#each additional_css}}
43 <link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
44 {{/each}}
45
46 {{#if mathjax_support}}
47 <!-- MathJax -->
48 <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
49 {{/if}}
50 </head>
51 <body class="sidebar-visible no-js">
52 <div id="body-container">
53 <!-- Provide site root to javascript -->
54 <script>
55 var path_to_root = "{{ path_to_root }}";
56 var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
57 </script>
58
59 <!-- Support dark mode -->
60 <script>
61 var theme;
62 try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
63 if (theme === null || theme === undefined) {
64 theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
65 }
66 var html = document.querySelector('html');
67 html.classList.remove('light', 'dark')
68 html.classList.add(theme);
69 var body = document.querySelector('body');
70 body.classList.remove('no-js')
71 body.classList.add('js');
72 </script>
73
74 <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
75
76 <!-- Hide / unhide sidebar before it is displayed -->
77 <script>
78 var body = document.querySelector('body');
79 var sidebar = null;
80 var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
81 if (document.body.clientWidth >= 1080) {
82 try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
83 sidebar = sidebar || 'visible';
84 } else {
85 sidebar = 'hidden';
86 }
87 sidebar_toggle.checked = sidebar === 'visible';
88 body.classList.remove('sidebar-visible');
89 body.classList.add("sidebar-" + sidebar);
90 </script>
91
92 <nav id="sidebar" class="sidebar" aria-label="Table of contents">
93 <div class="sidebar-scrollbox">
94 {{#toc}}{{/toc}}
95 </div>
96 <div style="display: none;" id="sidebar-resize-handle" class="sidebar-resize-handle">
97 <div class="sidebar-resize-indicator"></div>
98 </div>
99 </nav>
100
101 <!-- Track and set sidebar scroll position -->
102 <script>
103 var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
104 sidebarScrollbox.addEventListener('click', function(e) {
105 if (e.target.tagName === 'A') {
106 sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
107 }
108 }, { passive: true });
109 var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
110 sessionStorage.removeItem('sidebar-scroll');
111 if (sidebarScrollTop) {
112 // preserve sidebar scroll position when navigating via links within sidebar
113 sidebarScrollbox.scrollTop = sidebarScrollTop;
114 } else {
115 // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
116 var activeSection = document.querySelector('#sidebar .active');
117 if (activeSection) {
118 activeSection.scrollIntoView({ block: 'center' });
119 }
120 }
121 </script>
122
123 <div id="page-wrapper" class="page-wrapper">
124 <div class="page">
125 {{> header}}
126 <div id="menu-bar-hover-placeholder"></div>
127 <div id="menu-bar" class="menu-bar sticky">
128 <div class="left-buttons">
129
130 <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">
131 <i class="fa fa-bars"></i>
132 </label>
133
134 <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">
135 <i class="fa fa-paint-brush"></i>
136 </button>
137 <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
138 <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
139 <li role="none"><button role="menuitem" class="theme" id="dark">Dark</button></li>
140 </ul>
141
142 {{#if search_enabled}}
143 <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">
144 <i class="fa fa-search"></i>
145 </button>
146 {{/if}}
147 </div>
148
149 <header class="menu-title">
150 <a href="/">
151 <img src="https://zed.dev/logo_wordmark_1500.webp" alt="Zed Industries" style="height: 28px;">
152 </a>
153 </header>
154
155 <div class="right-buttons">
156 <a class="download-button" href="https://zed.dev/download" title="Download Zed" aria-label="Download Zed">
157 Download
158 </a>
159 {{#if git_repository_url}}
160 <a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
161 <i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
162 </a>
163 {{/if}}
164 {{#if git_repository_edit_url}}
165 <a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
166 <i id="git-edit-button" class="fa fa-edit"></i>
167 </a>
168 {{/if}}
169 </div>
170 </div>
171
172 {{#if search_enabled}}
173 <div id="search-wrapper" class="hidden">
174 <form id="searchbar-outer" class="searchbar-outer">
175 <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
176 </form>
177 <div id="searchresults-outer" class="searchresults-outer hidden">
178 <div id="searchresults-header" class="searchresults-header"></div>
179 <ul id="searchresults">
180 </ul>
181 </div>
182 </div>
183 {{/if}}
184
185 <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
186 <script>
187 document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
188 document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
189 Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
190 link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
191 });
192 </script>
193
194 <div id="content" class="content">
195 <main>
196 <div class="sidetoc">
197 <nav class="pagetoc">
198 <p class="toc-title">On this page</p>
199 </nav>
200 </div>
201 {{{ content }}}
202 </main>
203
204 <!-- Navigation arrows -->
205 <div class="nav-wrapper">
206 <div class="nav-buttons">
207 {{#previous}}
208 <a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-button" title="{{title}}" aria-label="Previous chapter">
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-button" title="{{title}}" aria-label="Next chapter">
215 <i class="fa fa-angle-right"></i>
216 </a>
217 {{/next}}
218 </div>
219 </div>
220 </div>
221 </div>
222 </div>
223
224 {{#if live_reload_endpoint}}
225 <!-- Livereload script (if served using the cli tool) -->
226 <script>
227 const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
228 const wsAddress = wsProtocol + "//" + location.host + "/" + "{{{live_reload_endpoint}}}";
229 const socket = new WebSocket(wsAddress);
230 socket.onmessage = function (event) {
231 if (event.data === "reload") {
232 socket.close();
233 location.reload();
234 }
235 };
236
237 window.onbeforeunload = function() {
238 socket.close();
239 }
240 </script>
241 {{/if}}
242
243 {{#if playground_line_numbers}}
244 <script>
245 window.playground_line_numbers = true;
246 </script>
247 {{/if}}
248
249 {{#if playground_copyable}}
250 <script>
251 window.playground_copyable = true;
252 </script>
253 {{/if}}
254
255 {{#if playground_js}}
256 <script src="{{ path_to_root }}ace.js"></script>
257 <script src="{{ path_to_root }}editor.js"></script>
258 <script src="{{ path_to_root }}mode-rust.js"></script>
259 <script src="{{ path_to_root }}theme-dawn.js"></script>
260 <script src="{{ path_to_root }}theme-tomorrow_night.js"></script>
261 {{/if}}
262
263 {{#if search_js}}
264 <script src="{{ path_to_root }}elasticlunr.min.js"></script>
265 <script src="{{ path_to_root }}mark.min.js"></script>
266 <script src="{{ path_to_root }}searcher.js"></script>
267 {{/if}}
268
269 <script src="{{ path_to_root }}clipboard.min.js"></script>
270 <script src="{{ path_to_root }}highlight.js"></script>
271 <script src="{{ path_to_root }}book.js"></script>
272
273 <!-- Custom JS scripts -->
274 {{#each additional_js}}
275 <script src="{{ ../path_to_root }}{{this}}"></script>
276 {{/each}}
277
278 {{#if is_print}}
279 {{#if mathjax_support}}
280 <script>
281 window.addEventListener('load', function() {
282 MathJax.Hub.Register.StartupHook('End', function() {
283 window.setTimeout(window.print, 100);
284 });
285 });
286 </script>
287 {{else}}
288 <script>
289 window.addEventListener('load', function() {
290 window.setTimeout(window.print, 100);
291 });
292 </script>
293 {{/if}}
294 {{/if}}
295
296 <script>
297 (function() {
298 var theme = localStorage.getItem('mdbook-theme');
299 var html = document.querySelector('html');
300 if (theme) {
301 html.setAttribute('data-theme', theme);
302 html.setAttribute('data-color-scheme', theme);
303 html.className = theme;
304 } else {
305 var systemPreference = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
306 html.setAttribute('data-theme', systemPreference);
307 html.setAttribute('data-color-scheme', systemPreference);
308 html.className = systemPreference;
309 }
310 })();
311 </script>
312
313
314 </div>
315 </body>
316</html>