-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathlayout.html
More file actions
373 lines (313 loc) · 16.8 KB
/
layout.html
File metadata and controls
373 lines (313 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
{%- extends "pydata_sphinx_theme/layout.html" %}
{% block css %}
<script src="https://unpkg.com/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
<script src="https://unpkg.com/tippy.js@6.3.1/dist/tippy-bundle.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
{% if mathjax_version == 3 %}
<script>
MathJax = {
loader: {load: ['[tex]/boldsymbol', '[tex]/textmacros']},
tex: {
packages: {'[+]': ['boldsymbol', 'textmacros']},
inlineMath: [['$', '$'], ['\\(', '\\)']],
processEscapes: true,
macros: {
"argmax" : "arg\\,max",
"argmin" : "arg\\,min",
"col" : "col",
"Span" : "span",
"epsilon": "\\varepsilon",
"EE": "\\mathbb{E}",
"PP": "\\mathbb{P}",
"RR": "\\mathbb{R}",
"NN": "\\mathbb{N}",
"ZZ": "\\mathbb{Z}",
"aA": "\\mathcal{A}",
"bB": "\\mathcal{B}",
"cC": "\\mathcal{C}",
"dD": "\\mathcal{D}",
"eE": "\\mathcal{E}",
"fF": "\\mathcal{F}",
"gG": "\\mathcal{G}",
"hH": "\\mathcal{H}",
}
},
svg: {
fontCache: 'global',
scale: 0.92,
displayAlign: "center",
},
};
</script>
{% endif %}
{{ super() }}
{% endblock %}
{% block extrahead %}
<!-- Normal Meta Tags -->
<meta name="author" context="{{ author | e }}" />
<meta name="keywords" content="{{ theme_keywords | e }}" />
<meta name="description" content={{ theme_description | e }} />
<!-- Twitter tags -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@{{ theme_twitter | e }}" />
<meta name="twitter:title" content="{% if pagetitle %}{{ pagetitle | e }}{% else %}{{ title | e }}{% endif %}"/>
<meta name="twitter:description" content="{{ theme_description | e }}">
<meta name="twitter:creator" content="@{{ theme_twitter | e }}">
<meta name="twitter:image" content="{{ theme_twitter_logo_url | e }}">
<!-- Opengraph tags -->
<meta property="og:title" content="{% if pagetitle %}{{ pagetitle | e }}{% else %}{{ docstitle | e }}{% endif %}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ pageurl | e }}" />
<meta property="og:image" content="{{ theme_og_logo_url | e }}" />
<meta property="og:description" content="{{ theme_description | e }}" />
<meta property="og:site_name" content="{{ docstitle | e }}" />
<meta name="theme-color" content="#ffffff" />
{% endblock %}
{# Silence the sidebar's, relbar's #}
{% block header %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{% block sidebarsourcelink %}{% endblock %}
{% block body_tag %}
<body{% if master_doc == pagename %} class="main-index"{% endif %}>
{%- endblock %}
{%- block content %}
<span id="top"></span>
<div class="qe-wrapper">
<div class="qe-main">
<div class="qe-page" id={{pagename}}>
<div class="qe-page__toc">
{% if theme_sticky_contents is defined and theme_sticky_contents is sameas true %}
<div class="inner sticky">
{%- else %}
<div class="inner">
{%- endif %}
{% set page_toc = generate_toc_html() %}
{%- if page_toc | length >= 1 %}
<div class="qe-page__toc-header">
On this page
</div>
{%- endif %}
<nav id="bd-toc-nav" class="qe-page__toc-nav">
{{ page_toc }}
<p class="logo">
{% if logo %}
{% if theme_header_organisation_url %}
<a href={{theme_header_organisation_url}}><img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo"></a>
{% else %}
<a href="{{ master_url }}"><img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="logo"></a>
{% endif %}
{% endif %}
</p>
<p class="powered">Powered by <a href="https://jupyterbook.org/">Jupyter Book</a></p>
</nav>
<div class="qe-page__toc-footer">
{# prev/next buttons #}
{% macro prev_next(prev, next, prev_title='', next_title='') %}
{%- if next %}
<p><a class='right-next' id="next-link" href="{{ next.link|e }}" title="{{ _('next page')}}"><strong>Next topic</strong><br>
{{ next_title or next.title }}</a></p>
{%- endif %}
{%- if prev %}
<p><a class='left-prev' id="prev-link" href="{{ prev.link|e }}" title="{{ _('previous page')}}"><strong>Previous topic</strong><br>
{{ prev_title or prev.title }}</a></p>
{%- endif %}
{% endmacro %}
<p><a href="#top"><strong>Back to top</strong></a></p>
</div>
</div>
</div>
<div class="qe-page__header">
<div class="qe-page__header-copy">
<p class="qe-page__header-heading"><a href="{{ master_url }}">{{ docstitle | e }}</a></p>
<p class="qe-page__header-subheading">{{ pagetitle | e }}</p>
</div>
<p class="qe-page__header-authors">{{ author }}</p>
</div> <!-- .page__header -->
{% block docs_main %}
<main class="qe-page__content" role="main">
{% block docs_body %}
<div>
{% block body %} {% endblock %}
</div>
{% endblock %}
</main> <!-- .page__content -->
{% endblock %}
<footer class="qe-page__footer">
<p><a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="https://licensebuttons.net/l/by-sa/4.0/80x15.png"></a></p>
<p>Creative Commons License – This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International.</p>
</footer> <!-- .page__footer -->
</div> <!-- .page -->
{% block docs_sidebar %}
{% if theme_persistent_sidebar is defined and theme_persistent_sidebar is sameas true %}
<div class="qe-sidebar bd-sidebar inactive persistent" id="site-navigation">
{%- else %}
<div class="qe-sidebar bd-sidebar inactive" id="site-navigation">
{%- endif %}
<div class="qe-sidebar__header">
Contents
</div>
<nav class="qe-sidebar__nav" id="qe-sidebar-nav" aria-label="Main navigation">
{{ sbt_generate_toctree_html(include_item_names=False, with_home_page=theme_home_page_in_toc) }}
</nav>
<div class="qe-sidebar__footer">
</div>
</div> <!-- .sidebar -->
{% endblock %}
</div> <!-- .main -->
<div class="qe-toolbar">
<div class="qe-toolbar__inner">
<ul class="qe-toolbar__main">
<li data-tippy-content="Table of Contents" class="btn__sidebar"><i data-feather="menu"></i></li>
<li data-tippy-content="Home"><a href="{{ master_url }}"><i data-feather="home"></i></a></li>
<li class="btn__qelogo"><a href="{{theme_header_organisation_url}}" title="{{html_title}}"><span class="show-for-sr">{{ theme_header_organisation}}</span></a></li>
<!-- <li class="btn__search">
<form action="{{ pathto('search') }}" method="get">
<input type="search" class="form-control" name="q" id="search-input" placeholder="{{ theme_search_bar_text }}" aria-label="{{ theme_search_bar_text }}" autocomplete="off">
<i data-feather="search"></i>
</form>
</li> -->
</ul>
<ul class="qe-toolbar__links">
<li data-tippy-content="Fullscreen" class="btn__fullscreen"><i data-feather="maximize"></i></li>
<li data-tippy-content="Increase font size" class="btn__plus"><i data-feather="plus-circle"></i></li>
<li data-tippy-content="Decrease font size" class="btn__minus"><i data-feather="minus-circle"></i></li>
<li data-tippy-content="Change contrast" class="btn__contrast"><i data-feather="sunset"></i></li>
{%- if notebook_path %}
<li data-tippy-content="Download Notebook"><a href="{{ notebook_path }}" download><i data-feather="download-cloud"></i></a></li>
{%- endif %}
{%- if theme_nb_repository_url %}
<li class="settings-button" id="settingsButton"><div data-tippy-content="Launch Notebook"><i data-feather="play-circle"></i></div></li>
{%- endif %}
{%- if pdf_book_path %}
<li class="download-pdf" id="downloadButton"><i data-feather="file"></i></li>
{%- else %}
<li data-tippy-content="Download PDF" onClick="window.print()"><i data-feather="file"></i></li>
{%- endif %}
<li data-tippy-content="View Source"><a target="_blank" href="{{ theme_repository_url }}{{github_sourcefolder}}/{{ sourcename }}" download><i data-feather="github"></i></a></li>
</ul>
</div>
</div> <!-- .toolbar -->
<div id="downloadPDFModal" style="display: none;">
<ul class="pdf-options" style="display: block;">
<li class="download-pdf-book" onClick="window.print()">
<p>Lecture (PDF)</p>
</li>
<li class="download-pdf-file">
<a href="{{ pdf_book_path }}" download><p>Book (PDF)</p></a>
</li>
</ul>
</div>
<div id="settingsModal" style="display: none;">
<p class="modal-title"> Notebook Launcher </p>
<div class="modal-desc">
<p>
Choose public or private cloud service for "Launch" button.
</p>
</div>
<p class="modal-subtitle">Select a server</p>
<ul class="modal-servers">
<li class="active launcher-public">
<span class="label">Public</span>
<select id="launcher-public-input">
{% for item in launch_buttons%}
<option value="{{item.url}}">{{item.name}}</option>
{% endfor %}
</select>
<i class="fas fa-check-circle"></i>
</li>
<li class="launcher-private">
<span class="label">Private</span>
<input type="text" id="launcher-private-input" data-repourl="{{theme_nb_repository_url}}" data-urlpath="{{jupyterhub_urlpath}}" data-branch={{repo_branch}}>
<i class="fas fa-check-circle"></i>
</li>
</ul>
<p class="launch"><a href="{{default_server}}" id="advancedLaunchButton" target="_blank">Launch Notebook</a></p>
<script>
// QuantEcon Notebook Launcher
const launcherTypeElements = document.querySelectorAll('#settingsModal .modal-servers li');
// Highlight the server type if previous selection exists
if (typeof localStorage.launcherType !== 'undefined') {
for (var i = 0; i < launcherTypeElements.length; i++) {
launcherTypeElements[i].classList.remove('active');
if ( launcherTypeElements[i].classList.contains(localStorage.launcherType) ) {
launcherTypeElements[i].classList.add('active');
}
}
}
// Highlight server type on click and set local storage value
for (var i = 0; i < launcherTypeElements.length; i++) {
launcherTypeElements[i].addEventListener('click', function() {
for (var j = 0; j < launcherTypeElements.length; j++) {
launcherTypeElements[j].classList.remove('active');
}
this.classList.add('active');
if ( this.classList.contains('launcher-private') ) {
localStorage.launcherType = 'launcher-private';
} else if ( this.classList.contains('launcher-public') ) {
localStorage.launcherType = 'launcher-public';
}
setLaunchServer();
})
}
const launcherPublic = document.getElementById('launcher-public-input');
const launcherPrivate = document.getElementById('launcher-private-input');
const pageName = "{{pagename}}";
const repoURL = "{{theme_nb_repository_url}}";
const urlPath = "{{jupyterhub_urlpath}}";
const branch = "{{repo_branch}}"
const launchNotebookLink = document.getElementById('advancedLaunchButton');
// Highlight public server option if previous selection exists
if (typeof localStorage.launcherPublic !== 'undefined') {
launcherPublic.value = localStorage.launcherPublic;
}
// Update local storage upon public server selection
launcherPublic.addEventListener('change', (event) => {
setLaunchServer();
});
// Populate private server input if previous entry exists
if (typeof localStorage.launcherPrivate !== 'undefined') {
launcherPrivate.value = localStorage.launcherPrivate;
}
// Update local storage when a private server is entered
launcherPrivate.addEventListener('input', (event) => {
setLaunchServer();
});
// Function to update the "Launch Notebook" link href
function setLaunchServer() {
launchNotebookLink.removeAttribute("style")
if ( localStorage.launcherType == 'launcher-private' ) {
let repoPrefix = "/jupyter/hub/user-redirect/git-pull?repo=" + repoURL + "&branch=" + branch + "&urlpath=" + urlPath;
launcherPrivateValue = launcherPrivate.value
if (!launcherPrivateValue) {
launchNotebookLink.removeAttribute("href")
launchNotebookLink.style.background = "grey"
return
}
localStorage.launcherPrivate = launcherPrivateValue;
privateServer = localStorage.launcherPrivate.replace(/\/$/, "")
if (!privateServer.includes("http")) {
privateServer = "http://" + privateServer
}
launchNotebookLinkURL = privateServer + repoPrefix;
} else if ( localStorage.launcherType == 'launcher-public' ) {
launcherPublicValue = launcherPublic.options[launcherPublic.selectedIndex].value;
localStorage.launcherPublic = launcherPublicValue;
launchNotebookLinkURL = localStorage.launcherPublic;
}
if (launchNotebookLinkURL) launchNotebookLink.href = launchNotebookLinkURL;
}
// Check if user has previously selected a server
if ( (typeof localStorage.launcherPrivate !== 'undefined') || (typeof localStorage.launcherPublic !== 'undefined') ) {
setLaunchServer();
}
</script>
</div>
</div> <!-- .wrapper-->
{%- block scripts_end %}
{%- endblock %}
{%- endblock %}
{% block docs_toc %}
{% endblock %}
{%- block footer %}
{%- endblock %}