-
Notifications
You must be signed in to change notification settings - Fork 10
/
preview.html
646 lines (562 loc) · 16 KB
/
preview.html
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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
<!DOCTYPE html>
<!--
# (c) Ilya V. Schurov, 2016
# Available under MIT license (see LICENSE file in the root folder)
This template is based on template_bootstrap_wtoc.html of DocOnce project (https://github.com/hplgit/doconce)
Copyright (c) 2007-2015, Hans Petter Langtangen <hpl@simula.no> and
Simula Resarch Laboratory.
Available under BSD 3-Clause License, see https://github.com/hplgit/doconce/blob/master/LICENSE for details.
-->
<html lang="{{ meta.get('lang', 'en') if meta else 'en'}}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>{{ title }}</title>
<style type="text/css">
span.env-title, span.paragraph {
font-weight: bold;
}
img.figure, video.figure {
margin-left: auto;
margin-right: auto;
display: block;
}
div.figure {
text-align: center;
border-bottom: #cccccc 1px solid;
border-top: #cccccc 1px solid;
margin-bottom: 1em;
margin-top: 1em;
}
div.figure_caption {
font-size: 90%;
}
div.figure_caption_nocenter {
margin-left: 5em;
margin-right: 5em;
text-align: left;
}
div.figure_caption_center {
text-align: center;
}
li.toc_item_level_1 {
font-weight: bold;
}
li.toc_item_level_2 {
margin-left: 20px;
}
div.figure {
padding-bottom: 20px;
}
body {
position: relative;
}
.container {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
.affix-top {
position: relative;
width: 200px;
}
.affix {
top: 20px;
}
.affix,
.affix-bottom {
width: 200px;
}
.affix-bottom {
position: absolute;
}
footer {
padding: 15px 0;
background-color: #eee;
color: #aaa;
font-size: 90%;
}
.scrollable-menu {
height: auto;
max-height: 80vh;
overflow-x: hidden;
}
</style>
<!-- Bootstrap style: http://getbootstrap.com/getting-started/
What to change in this template:
URL to the document (edit http://some.website.net/some/path)
LINK1, LINK2 links in the navigation topbar (remove, edit, or add more)
Footer with author(s) and copyright (remove or edit)
-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/qtip2/2.2.1/jquery.qtip.min.css" />
<!-- Can add other themes and adjust colors in the navigation sidebar -->
<!--
<link href="http://netdna.bootstrapcdn.com/bootswatch/3.1.1/journal/bootstrap.min.css" rel="stylesheet">
-->
<!-- Potential adjustment of styles -->
<style type="text/css">
/* Colors in the navigation sidebar */
/*
.bs-docs-sidebar .nav > li > a {
color: #999;
}
.bs-docs-sidebar .nav > li > a:hover,
.bs-docs-sidebar .nav > li > a:focus {
color: #999;
}
.bs-docs-sidebar .nav > .active > a,
.bs-docs-sidebar .nav > .active:hover > a,
.bs-docs-sidebar .nav > .active:focus > a {
color: #563d7c;
}
*/
a.snippet-ref {
color: inherit;
border-bottom: 1px dashed #999;
cursor: default;
}
div.quiz {
padding-top: 0.4em;
}
a.quiz-choice {
color: #31708f;
}
a.quiz-choice:hover {
text-decoration: none;
}
div.env__question {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
img.figure {
max-width:600px;
width:100%;
}
.toggle{
text-transform: capitalize;
}
/*
div.env__proof {
background:rgba(30,150,30,0.03);
padding: 1em;
margin-left: -1em;
margin-right: 1em;
}
*/
span.end-of-proof {
float: right;
}
span.section__number {
float: right;
color: #aaaaaa;
margin-left: 2em;
}
a.section__number {
color: #aaaaaa;
}
a.env-title {
color: inherit;
}
a.figure_caption_anchor {
color: inherit;
}
div.plotly-graph-div {
margin: auto;
}
.dropdown-menu > li > a {
color: #337ab7;
}
.dropdown-menu > li > a.nav-curchapter {
color: inherit;
}
/* By default it's not affixed in mobile views, so undo that */
.bs-docs-sidebar.affix {
position: static;
}
@media (min-width: 768px) {
.bs-docs-sidebar {
padding-left: 20px;
}
}
/* Chapter heading in sidenav */
.bs-docs-sidebar .sidebar-chapter-heading {
padding-bottom: 0px;
margin-bottom: 0px;
/* border-bottom: 1px solid #555 ; */
}
/* First level of nav */
.bs-docs-sidenav {
margin-top: 15px;
margin-bottom: 20px;
}
/* All levels of nav */
.bs-docs-sidebar .sidebar-chapter-heading a {
font-size: 13px;
font-weight: bold;
color: #767676;
}
.bs-docs-sidebar .sidebar-chapter-heading a:hover,
.bs-docs-sidebar .sidebar-chapter-heading a:focus
{
color: #1f77b4;
text-decoration: none;
background-color: transparent;
}
.bs-docs-sidebar .nav > li > a {
display: block;
padding: 4px 20px;
font-size: 13px;
font-weight: 500;
color: #767676;
}
.bs-docs-sidebar .nav > li > a:hover,
.bs-docs-sidebar .nav > li > a:focus {
padding-left: 18px;
color: #1f77b4;
text-decoration: none;
background-color: transparent;
border-left: 2px solid #1f77b4;
}
.bs-docs-sidebar .nav > .active > a,
.bs-docs-sidebar .nav > .active:hover > a,
.bs-docs-sidebar .nav > .active:focus > a {
padding-left: 18px;
font-weight: bold;
color: #1f77b4;
background-color: transparent;
border-left: 2px solid #1f77b4;
}
/* Nav: second level (shown on .active) */
.bs-docs-sidebar .nav .nav {
display: none; /* Hide by default, but at >768px, show it */
padding-bottom: 10px;
}
.bs-docs-sidebar .nav .nav > li > a {
padding-top: 3px;
padding-bottom: 3px;
padding-left: 30px;
font-size: 12px;
font-weight: normal;
}
.bs-docs-sidebar .nav .nav > li > a:hover,
.bs-docs-sidebar .nav .nav > li > a:focus {
padding-left: 28px;
}
.bs-docs-sidebar .nav .nav > .active > a,
.bs-docs-sidebar .nav .nav > .active:hover > a,
.bs-docs-sidebar .nav .nav > .active:focus > a {
padding-left: 28px;
font-weight: 500;
}
/* Back to top (hidden on mobile) */
.back-to-top,
.bs-docs-theme-toggle {
display: none;
padding: 4px 10px;
margin-top: 10px;
margin-left: 10px;
font-size: 12px;
font-weight: 500;
color: #999;
}
.back-to-top:hover,
.bs-docs-theme-toggle:hover {
color: #1f77b4;
text-decoration: none;
}
.bs-docs-theme-toggle {
margin-top: 0;
}
@media (min-width: 768px) {
.back-to-top,
.bs-docs-theme-toggle {
display: block;
}
}
/* Show and affix the side nav when space allows it */
@media (min-width: 992px) {
.bs-docs-sidebar .nav > .active > ul {
display: block;
}
/* Widen the fixed sidebar */
.bs-docs-sidebar.affix,
.bs-docs-sidebar.affix-bottom {
width: 213px;
}
.bs-docs-sidebar.affix {
position: fixed; /* Undo the static from mobile first approach */
top: 20px;
}
.bs-docs-sidebar.affix-bottom {
position: absolute; /* Undo the static from mobile first approach */
}
.bs-docs-sidebar.affix-bottom .bs-docs-sidenav,
.bs-docs-sidebar.affix .bs-docs-sidenav {
margin-top: 0;
margin-bottom: 0;
}
}
@media (min-width: 1200px) {
/* Widen the fixed sidebar again */
.bs-docs-sidebar.affix-bottom,
.bs-docs-sidebar.affix {
width: 263px;
}
}
div.qtip {
min-width: 600px;
}
@media screen and (min-width: 768px) {
.splitted-eq {
display: none;
}
}
@media print {
.splitted-eq {
display: none;
}
}
@media screen and (max-width: 768px) {
.long-eq {
display: none;
}
}
.smart-scroll{
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1030;
}
.scrolled-down{
transform:translateY(-100%); transition: all 0.3s ease-in-out;
}
.scrolled-up{
transform:translateY(0); transition: all 0.3s ease-in-out;
}
</style>
</head>
<body data-spy="scroll" data-target="#sidebar-wrapper">
{% if meta and meta.preamble_ %}
<div style='visibility: hidden; display: none;'>
\[
{{ meta.get("preamble", "") | safe }}
\]
</div>
{% endif %}
{% macro render_ftoc(ftoc, numbers=True) %}
{% for item in ftoc.children recursive %}
<li>
{%- if item.string -%}
<a href="{{ item.href }}" {%- if item.iscurchapter -%} class="nav-curchapter"{%- endif %}>
{%- if numbers and item.tag.get("number") -%}{{ item.tag.get("number") }}. {% endif -%}{{ item.string }}
</a>
{%- endif -%}
{%- if item.children -%}
<ul class="nav">{{ loop(item.children) }}</ul>
{%- endif -%}
</li>
{% endfor %}
{% endmacro %}
<nav class="navbar navbar-default navbar-fixed-top smart-scroll scrolled-up">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% if prev is not none or next is not none %}
{% if prev is not none %}
<li>
<a href="{{ prev | safe }}">← Предыдущая глава</a>
</li>
{% endif %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Содержание <span class="caret"></span></a>
<ul class="dropdown-menu scrollable-menu" role="menu">
{{ render_ftoc(ftoc) }}
</ul>
</li>
{% endif %}
{% if meta %}
{% for link in meta("link") %}
<li>
<a href="{{ link.get("url") }}">{{ link.text_content }}</a>
</li>
{% endfor %}
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if next is not none %}
<li class="next">
<a href="{{ next | safe }}">Следующая глава →</a>
</li>
{% endif %}
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
{% if meta %}
<div class="jumbotron">
<div class="container">
<div class="page-header">
<h1>{{ meta.get("title") }}
{% if meta.subtitle_ %}<br/>
<small>{{ meta.get("subtitle") }}</small>
{% endif %}
</h1>
{% if meta.author_ %}
<p>{{ meta.author_.text_content }}
{% if meta.author_.affiliation_ %}
({{ meta.author_.affiliation_.text_content }})
{% endif %}
</p>
{% endif %}
</div>
</div>
</div>
{% endif %}
<div class="container">
<div class="row">
<!-- main content -->
<div class="col-md-9" role="main">
{{ preamble | safe }}
{{ html | safe }}
<hr/>
{% if prev is not none or next is not none %}
<div class="text-center" style="padding-bottom: 1.5em;">
{% if prev is not none %}
<a href="{{ prev | safe }}" class="btn btn-link">← Предыдущая глава</a>
{% endif %}
{% if next is not none %}
<a href="{{ next | safe }}" class="btn btn-link">Следующая глава →</a>
{% endif %}
</div>
{% endif %}
</div>
<div class="col-md-3 scrollspy" role="complementary" id="sidebar-wrapper">
<nav class="bs-docs-sidebar hidden-print hidden-sm hidden-xs">
<div id="sidebar">
<div class="sidebar-chapter-heading">
<a href="{{ curftoc.href }}">
{{ curftoc.string }}
</a>
</div>
<ul class="nav bs-docs-sidenav" >
{{ render_ftoc(curftoc, False) }}
</ul>
</div>
</nav>
</div>
</div>
</div>
{% if template_options and template_options.get("footer") %}
<footer>
<div class="container">
<div class="row">
<div class="col-md-9">
{{ template_options['footer'] | safe }}
</div>
</div>
</div>
</footer>
{% endif %}
<!-- <script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> -->
<script src="{{ url_for('send_asset', path='js/mathjax/MathJax.js') }}?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ["\\[","\\]"] ],
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<!-- JavaScript placed at the end of the document so the pages load faster -->
{{ js_bottom | safe }}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script defer="defer">
$(function() {
"use strict";
var $window = $(window);
var $body = $(document.body);
{{ js_onload | safe }}
})
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script>
$('#sidebar').affix({
offset: {
top: $('#sidebar').offset().top
}
});
</script>
<!-- NOTE: replace rawgit.com by cdn.rawgit.com for production or
sites with heavy traffic -->
<!-- <script src="https://rawgit.com/hplgit/doconce/master/bundled/html_styles/style_bootstrap_wtoc/js/docs.min.js"></script> -->
<!-- Include either the minifed or production version, NOT both!! -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/qtip2/2.2.1/jquery.qtip.min.js"></script>
<!-- Optional: imagesLoaded script to better support images inside your tooltips -->
<script src="https://unpkg.com/imagesloaded@4.1/imagesloaded.pkgd.min.js"></script>
<script type="text/javascript">
$('[data-url]').qtip({
style: 'qtip-bootstrap',
hide: {
fixed: true,
delay: 300
},
show: {
delay: 500
},
content: {
text: function(event, api) {
$.ajax({
url: api.elements.target.attr('data-url') // Use data-url attribute for the URL
})
.then(function(content) {
// Set the tooltip content upon successful retrieval
api.set('content.text', content);
// Update math
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}, function(xhr, status, error) {
// Upon failure... set the tooltip content to the status and error value
api.set('content.text', status + ': ' + error);
});
return 'Loading...'; // Set some initial text
}
}
});
// detect scroll top or down
if ($('.smart-scroll').length > 0) { // check if element exists
var last_scroll_top = 0;
$(window).on('scroll', function() {
scroll_top = $(this).scrollTop();
if(scroll_top < last_scroll_top || scroll_top < $('.navbar').outerHeight()) {
$('.smart-scroll').removeClass('scrolled-down').addClass('scrolled-up');
}
else {
$('.smart-scroll').removeClass('scrolled-up').addClass('scrolled-down');
}
last_scroll_top = scroll_top;
});
}
</script>
</body>
</html>