-
Notifications
You must be signed in to change notification settings - Fork 576
/
Copy pathindex.html.j2
181 lines (154 loc) · 5.2 KB
/
index.html.j2
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
{%- extends 'base.html.j2' -%}
{% from 'mathjax.html.j2' import mathjax %}
{% from 'jupyter_widgets.html.j2' import jupyter_widgets %}
{% set reveal_url_prefix = resources.reveal.url_prefix | default('https://unpkg.com/[email protected]', true) %}
{% set reveal_theme = resources.reveal.theme | default('white', true) %}
{% set reveal_transition = resources.reveal.transition | default('slide', true) %}
{% set reveal_number = resources.reveal.number | default('', true) %}
{% set reveal_scroll = resources.reveal.scroll | default(false, true) | json_dumps %}
{%- block header -%}
<!DOCTYPE html>
<html>
<head>
{%- block html_head -%}
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
{% set nb_title = nb.metadata.get('title', resources['metadata']['name']) | escape_html_keep_quotes %}
<title>{{nb_title}} slides</title>
{%- block html_head_js -%}
{%- block html_head_js_jquery -%}
<script src="{{ resources.jquery_url }}"></script>
{%- endblock html_head_js_jquery -%}
{%- block html_head_js_requirejs -%}
<script src="{{ resources.require_js_url }}"></script>
{%- endblock html_head_js_requirejs -%}
{%- endblock html_head_js -%}
{% block jupyter_widgets %}
{%- if "widgets" in nb.metadata -%}
{{ jupyter_widgets(resources.jupyter_widgets_base_url, resources.html_manager_semver_range, resources.widget_renderer_url) }}
{%- endif -%}
{% endblock jupyter_widgets %}
<!-- General and theme style sheets -->
<link rel="stylesheet" href="{{ reveal_url_prefix }}/dist/reveal.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
{% for css in resources.inlining.css -%}
<style type="text/css">
{{ css }}
</style>
{% endfor %}
{% block notebook_css %}
{{ resources.include_css("static/index.css") }}
{% if resources.theme == 'dark' %}
{{ resources.include_css("static/theme-dark.css") }}
{% else %}
{{ resources.include_css("static/theme-light.css") }}
{% endif %}
<style type="text/css">
a.anchor-link {
display: none;
}
.highlight {
margin: 0.4em;
}
.jp-Notebook {
padding: 0;
}
:root {
--jp-ui-font-size1: 20px; /* instead of 14px */
--jp-content-font-size1: 20px; /* instead of 14px */
--jp-code-font-size: 19px; /* instead of 13px */
--jp-cell-prompt-width: 110px; /* instead of 64px */
}
@media print {
body {
margin: 0;
}
}
</style>
{{ resources.include_css("static/custom_reveal.css") }}
{% endblock notebook_css %}
{%- block html_head_js_mathjax -%}
{{ mathjax(resources.mathjax_url) }}
{%- endblock html_head_js_mathjax -%}
{%- block html_head_css -%}
{%- endblock html_head_css -%}
{%- endblock html_head -%}
<!-- Reveal Theme -->
<link rel="stylesheet" href="{{ reveal_url_prefix }}/dist/theme/{{reveal_theme}}.css" id="theme">
</head>
{% endblock header%}
{%- block body_header -%}
{% if resources.theme == 'dark' %}
<body class="jp-Notebook" data-jp-theme-light="false" data-jp-theme-name="JupyterLab Dark">
{% else %}
<body class="jp-Notebook" data-jp-theme-light="true" data-jp-theme-name="JupyterLab Light">
{% endif %}
<div class="reveal">
<div class="slides">
{%- endblock body_header -%}
{% block body_footer %}
</div>
</div>
</body>
{% endblock body_footer %}
{% block footer %}
{{ super() }}
{% block footer_js %}
<script>
require(
{
// it makes sense to wait a little bit when you are loading
// reveal from a cdn in a slow connection environment
waitSeconds: 15
},
[
"{{ reveal_url_prefix }}/dist/reveal.js",
"{{ reveal_url_prefix }}/plugin/notes/notes.js"
],
function(Reveal, RevealNotes){
// Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
transition: "{{reveal_transition}}",
slideNumber: "{{reveal_number}}",
plugins: [RevealNotes]
});
var update = function(event){
if(MathJax.Hub.getAllJax(Reveal.getCurrentSlide())){
MathJax.Hub.Rerender(Reveal.getCurrentSlide());
}
};
Reveal.addEventListener('slidechanged', update);
function setScrollingSlide() {
var scroll = {{ reveal_scroll }}
if (scroll === true) {
var h = $('.reveal').height() * 0.95;
$('section.present').find('section')
.filter(function() {
return $(this).height() > h;
})
.css('height', 'calc(95vh)')
.css('overflow-y', 'scroll')
.css('margin-top', '20px');
}
}
// check and set the scrolling slide every time the slide change
Reveal.addEventListener('slidechanged', setScrollingSlide);
}
);
</script>
{% endblock footer_js %}
</html>
{% endblock footer %}