-
Notifications
You must be signed in to change notification settings - Fork 0
/
jupyter_template.tpl
62 lines (60 loc) · 2.16 KB
/
jupyter_template.tpl
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
{%- extends 'slides_reveal.tpl' -%}
{% block post_slides %}
<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
},
[
"{{resources.reveal.url_prefix}}/lib/js/head.min.js",
"{{resources.reveal.url_prefix}}/js/reveal.js"
],
function(head, Reveal){
// Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: false,
progress: true,
history: true,
transition: "{{resources.reveal.transition}}",
width: 960,
height: 540,
margin: 0,
minScale: 0.2,
maxScale: 2,
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: "{{resources.reveal.url_prefix}}/lib/js/classList.js",
condition: function() { return !document.body.classList; } },
{ src: "{{resources.reveal.url_prefix}}/plugin/notes/notes.js",
async: true,
condition: function() { return !!document.body.classList; } }
]
});
var update = function(event){
if(MathJax.Hub.getAllJax(Reveal.getCurrentSlide())){
MathJax.Hub.Rerender(Reveal.getCurrentSlide());
}
};
Reveal.addEventListener('slidechanged', update);
function setScrollingSlide() {
var scroll = {{ resources.reveal.scroll | json_dumps }}
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>
</body>
{% endblock post_slides %}