Skip to content

Commit 69eee11

Browse files
authored
chore(docs): update template in docs (#565)
The template displayed in the *Customize your RevealJS slides* was out of sync.
1 parent 9abe05b commit 69eee11

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- Update the comparison table in the README.
1717
[#560](https://github.com/jeertmans/manim-slides/pull/560)
18+
- Update the template in the *Customize your RevealJS slides* section.
19+
[#565](https://github.com/jeertmans/manim-slides/pull/565)
1820

1921
(v5.5.2)=
2022
## [v5.5.2](https://github.com/jeertmans/manim-slides/compare/v5.5.1...v5.5.2)

docs/source/_static/template.html

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
</div>
5151

5252
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/reveal.min.js"></script>
53+
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/plugin/notes/notes.min.js"></script>
5354

5455
<!-- To include plugins, see: https://revealjs.com/plugins/ -->
5556
{% if has_notes %}
56-
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/plugin/markdown/markdown.min.js"></script>
57-
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/plugin/notes/notes.min.js"></script>
57+
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/plugin/markdown/markdown.min.js"></script>
5858
{% endif %}
5959

6060
<!-- <script src="index.js"></script> -->
@@ -262,6 +262,23 @@
262262
// Time before the cursor is hidden (in ms)
263263
hideCursorTime: {{ hide_cursor_time }}
264264
});
265+
// Override SPACE to play / pause the video
266+
Reveal.addKeyBinding(
267+
{
268+
keyCode: 32,
269+
key: 'SPACE',
270+
description: 'Play / pause video'
271+
},
272+
() => {
273+
var currentVideos = Reveal.getCurrentSlide().slideBackgroundContentElement.getElementsByTagName("video");
274+
if (currentVideos.length > 0) {
275+
if (currentVideos[0].paused == true) currentVideos[0].play();
276+
else currentVideos[0].pause();
277+
} else {
278+
Reveal.next();
279+
}
280+
}
281+
);
265282
{% if one_file %}
266283
// Fix found by @t-fritsch and @Rapsssito on GitHub
267284
// see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-11733074.
@@ -306,6 +323,13 @@
306323
Reveal.on( 'ready', fixBase64VideoBackground );
307324
{% endif %}
308325
</script>
326+
{% if env['READTHEDOCS'] %}
327+
<style>
328+
readthedocs-flyout, readthedocs-notification {
329+
display: none;
330+
}
331+
</style>
332+
{% endif %}
309333

310334
<!-- Add a clock to each section dynamically using JavaScript -->
311335
<script>

0 commit comments

Comments
 (0)