|
19 | 19 | <body>
|
20 | 20 | <div class="reveal">
|
21 | 21 | <div class="slides">
|
22 |
| - {%- for presentation_config in presentation_configs -%} |
23 |
| - {% set outer_loop = loop %} |
24 |
| - {%- for slide_config in presentation_config.slides -%} |
25 |
| - {%- if data_uri -%} |
| 22 | + {% for presentation_config in presentation_configs %} |
| 23 | + {%- set outer_loop = loop -%} |
| 24 | + {% for slide_config in presentation_config.slides %} |
| 25 | + {% if data_uri %} |
26 | 26 | {% set file = file_to_data_uri(slide_config.file) %}
|
27 |
| - {%- else -%} |
| 27 | + {% else %} |
28 | 28 | {% set file = assets_dir / slide_config.file.name %}
|
29 |
| - {%- endif -%} |
| 29 | + {% endif %} |
30 | 30 | <section
|
31 | 31 | data-background-size={{ background_size }}
|
32 | 32 | data-background-color="{{ presentation_config.background_color }}"
|
33 | 33 | data-background-video="{{ file }}"
|
34 |
| - {% if loop.index == 1 and outer_loop.index == 1 -%} |
| 34 | + {% if loop.index == 1 and outer_loop.index == 1 %} |
35 | 35 | data-background-video-muted
|
36 |
| - {%- endif -%} |
37 |
| - {% if slide_config.loop -%} |
| 36 | + {% endif %} |
| 37 | + {% if slide_config.loop %} |
38 | 38 | data-background-video-loop
|
39 |
| - {%- endif -%} |
40 |
| - {% if slide_config.auto_next -%} |
| 39 | + {% endif %} |
| 40 | + {% if slide_config.auto_next %} |
41 | 41 | data-autoslide="{{ get_duration_ms(slide_config.file) }}"
|
42 |
| - {%- endif -%}> |
43 |
| - {% if slide_config.notes != "" -%} |
| 42 | + {% endif %} |
| 43 | + > |
| 44 | + {% if slide_config.notes != "" %} |
44 | 45 | <aside class="notes" data-markdown>{{ slide_config.notes }}</aside>
|
45 |
| - {%- endif %} |
| 46 | + {% endif %} |
46 | 47 | </section>
|
47 |
| - {%- endfor -%} |
48 |
| - {%- endfor -%} |
| 48 | + {% endfor %} |
| 49 | + {% endfor %} |
49 | 50 | </div>
|
50 | 51 | </div>
|
51 | 52 |
|
52 | 53 | <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/reveal.min.js"></script>
|
53 | 54 |
|
54 | 55 | <!-- To include plugins, see: https://revealjs.com/plugins/ -->
|
55 |
| - |
56 |
| - {% if has_notes -%} |
| 56 | + {% if has_notes %} |
57 | 57 | <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/plugin/markdown/markdown.min.js"></script>
|
58 | 58 | <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/{{ reveal_version }}/plugin/notes/notes.min.js"></script>
|
59 |
| - {%- endif -%} |
| 59 | + {% endif %} |
60 | 60 |
|
61 | 61 | <!-- <script src="index.js"></script> -->
|
62 | 62 | <script>
|
63 | 63 | Reveal.initialize({
|
64 |
| - {% if has_notes -%} |
| 64 | + {% if has_notes %} |
| 65 | + /// The list of RevealJS plugins. |
65 | 66 | plugins: [ RevealMarkdown, RevealNotes ],
|
66 |
| - {%- endif %} |
| 67 | + {% endif %} |
67 | 68 | // The "normal" size of the presentation, aspect ratio will
|
68 | 69 | // be preserved when the presentation is scaled to fit different
|
69 | 70 | // resolutions. Can be specified using percentage units.
|
70 | 71 | width: {{ width }},
|
71 | 72 | height: {{ height }},
|
72 |
| - |
73 | 73 | // Factor of the display size that should remain empty around
|
74 | 74 | // the content
|
75 | 75 | margin: {{ margin }},
|
76 |
| - |
77 | 76 | // Bounds for smallest/largest possible scale to apply to content
|
78 | 77 | minScale: {{ min_scale }},
|
79 | 78 | maxScale: {{ max_scale }},
|
80 |
| - |
81 | 79 | // Display presentation control arrows
|
82 | 80 | controls: {{ controls }},
|
83 |
| - |
84 | 81 | // Help the user learn the controls by providing hints, for example by
|
85 | 82 | // bouncing the down arrow when they first encounter a vertical slide
|
86 | 83 | controlsTutorial: {{ controls_tutorial }},
|
87 |
| - |
88 | 84 | // Determines where controls appear, "edges" or "bottom-right"
|
89 | 85 | controlsLayout: {{ controls_layout }},
|
90 |
| - |
91 | 86 | // Visibility rule for backwards navigation arrows; "faded", "hidden"
|
92 | 87 | // or "visible"
|
93 | 88 | controlsBackArrows: {{ controls_back_arrows }},
|
94 |
| - |
95 | 89 | // Display a presentation progress bar
|
96 | 90 | progress: {{ progress }},
|
97 |
| - |
98 | 91 | // Display the page number of the current slide
|
99 | 92 | // - true: Show slide number
|
100 | 93 | // - false: Hide slide number
|
|
110 | 103 | // object and return an array with one string [slideNumber] or
|
111 | 104 | // three strings [n1,delimiter,n2]. See #formatSlideNumber().
|
112 | 105 | slideNumber: {{ slide_number }},
|
113 |
| - |
114 | 106 | // Can be used to limit the contexts in which the slide number appears
|
115 | 107 | // - "all": Always show the slide number
|
116 | 108 | // - "print": Only when printing to PDF
|
117 | 109 | // - "speaker": Only in the speaker view
|
118 | 110 | showSlideNumber: {{ show_slide_number }},
|
119 |
| - |
120 | 111 | // Use 1 based indexing for # links to match slide number (default is zero
|
121 | 112 | // based)
|
122 | 113 | hashOneBasedIndex: {{ hash_one_based_index }},
|
123 |
| - |
124 | 114 | // Add the current slide number to the URL hash so that reloading the
|
125 | 115 | // page/copying the URL will return you to the same slide
|
126 | 116 | hash: {{ hash }},
|
127 |
| - |
128 | 117 | // Flags if we should monitor the hash and change slides accordingly
|
129 | 118 | respondToHashChanges: {{ respond_to_hash_changes }},
|
130 |
| - |
131 |
| - // Push each slide change to the browser history. Implies `hash: true` |
| 119 | + // Push each slide change to the browser history. Implies `hash: true` |
132 | 120 | history: {{ history }},
|
133 |
| - |
134 | 121 | // Enable keyboard shortcuts for navigation
|
135 | 122 | keyboard: {{ keyboard }},
|
136 |
| - |
137 | 123 | // Optional function that blocks keyboard events when retuning false
|
138 | 124 | //
|
139 | 125 | // If you set this to 'focused', we will only capture keyboard events
|
140 | 126 | // for embedded decks when they are in focus
|
141 | 127 | keyboardCondition: {{ keyboard_condition }},
|
142 |
| - |
143 | 128 | // Disables the default reveal.js slide layout (scaling and centering)
|
144 | 129 | // so that you can use custom CSS layout
|
145 | 130 | disableLayout: {{ disable_layout }},
|
146 |
| - |
147 | 131 | // Enable the slide overview mode
|
148 | 132 | overview: {{ overview }},
|
149 |
| - |
150 | 133 | // Vertical centering of slides
|
151 | 134 | center: {{ center }},
|
152 |
| - |
153 | 135 | // Enables touch navigation on devices with touch input
|
154 | 136 | touch: {{ touch }},
|
155 |
| - |
156 | 137 | // Loop the presentation
|
157 | 138 | loop: {{ loop }},
|
158 |
| - |
159 | 139 | // Change the presentation direction to be RTL
|
160 | 140 | rtl: {{ rtl }},
|
161 |
| - |
162 | 141 | // Changes the behavior of our navigation directions.
|
163 | 142 | //
|
164 | 143 | // "default"
|
|
184 | 163 | // from 1.3 -> 2.1. If "grid" is used, the same navigation takes you
|
185 | 164 | // from 1.3 -> 2.3.
|
186 | 165 | navigationMode: {{ navigation_mode }},
|
187 |
| - |
188 | 166 | // Randomizes the order of slides each time the presentation loads
|
189 | 167 | shuffle: {{ shuffle }},
|
190 |
| - |
191 | 168 | // Turns fragments on and off globally
|
192 | 169 | fragments: {{ fragments }},
|
193 |
| - |
194 | 170 | // Flags whether to include the current fragment in the URL,
|
195 | 171 | // so that reloading brings you to the same fragment position
|
196 | 172 | fragmentInURL: {{ fragment_in_url }},
|
197 |
| - |
198 | 173 | // Flags if the presentation is running in an embedded mode,
|
199 | 174 | // i.e. contained within a limited portion of the screen
|
200 | 175 | embedded: {{ embedded }},
|
201 |
| - |
202 | 176 | // Flags if we should show a help overlay when the question-mark
|
203 | 177 | // key is pressed
|
204 | 178 | help: {{ help }},
|
205 |
| - |
206 | 179 | // Flags if it should be possible to pause the presentation (blackout)
|
207 | 180 | pause: {{ pause }},
|
208 |
| - |
209 | 181 | // Flags if speaker notes should be visible to all viewers
|
210 | 182 | showNotes: {{ show_notes }},
|
211 |
| - |
212 | 183 | // Global override for autolaying embedded media (video/audio/iframe)
|
213 | 184 | // - null: Media will only autoplay if data-autoplay is present
|
214 | 185 | // - true: All media will autoplay, regardless of individual setting
|
215 | 186 | // - false: No media will autoplay, regardless of individual setting
|
216 | 187 | autoPlayMedia: {{ auto_play_media }},
|
217 |
| - |
218 | 188 | // Global override for preloading lazy-loaded iframes
|
219 | 189 | // - null: Iframes with data-src AND data-preload will be loaded when within
|
220 | 190 | // the viewDistance, iframes with only data-src will be loaded when visible
|
221 | 191 | // - true: All iframes with data-src will be loaded when within the viewDistance
|
222 | 192 | // - false: All iframes with data-src will be loaded only when visible
|
223 | 193 | preloadIframes: {{ preload_iframes }},
|
224 |
| - |
225 | 194 | // Can be used to globally disable auto-animation
|
226 | 195 | autoAnimate: {{ auto_animate }},
|
227 |
| - |
228 | 196 | // Optionally provide a custom element matcher that will be
|
229 | 197 | // used to dictate which elements we can animate between.
|
230 | 198 | autoAnimateMatcher: {{ auto_animate_matcher }},
|
231 |
| - |
232 | 199 | // Default settings for our auto-animate transitions, can be
|
233 | 200 | // overridden per-slide or per-element via data arguments
|
234 | 201 | autoAnimateEasing: {{ auto_animate_easing }},
|
235 | 202 | autoAnimateDuration: {{ auto_animate_duration }},
|
236 | 203 | autoAnimateUnmatched: {{ auto_animate_unmatched }},
|
237 |
| - |
238 | 204 | // CSS properties that can be auto-animated. Position & scale
|
239 | 205 | // is matched separately so there's no need to include styles
|
240 | 206 | // like top/right/bottom/left, width/height or margin.
|
241 | 207 | autoAnimateStyles: {{ auto_animate_styles }},
|
242 |
| - |
243 | 208 | // Controls automatic progression to the next slide
|
244 | 209 | // - 0: Auto-sliding only happens if the data-autoslide HTML attribute
|
245 | 210 | // is present on the current slide or fragment
|
246 | 211 | // - 1+: All slides will progress automatically at the given interval
|
247 | 212 | // - false: No auto-sliding, even if data-autoslide is present
|
248 | 213 | autoSlide: {{ auto_slide }},
|
249 |
| - |
250 | 214 | // Stop auto-sliding after user input
|
251 | 215 | autoSlideStoppable: {{ auto_slide_stoppable }},
|
252 |
| - |
253 | 216 | // Use this method for navigation when auto-sliding (defaults to navigateNext)
|
254 | 217 | autoSlideMethod: {{ auto_slide_method }},
|
255 |
| - |
256 | 218 | // Specify the average time in seconds that you think you will spend
|
257 | 219 | // presenting each slide. This is used to show a pacing timer in the
|
258 | 220 | // speaker view
|
259 | 221 | defaultTiming: {{ default_timing }},
|
260 |
| - |
261 | 222 | // Enable slide navigation via mouse wheel
|
262 | 223 | mouseWheel: {{ mouse_wheel }},
|
263 |
| - |
264 | 224 | // Opens links in an iframe preview overlay
|
265 | 225 | // Add `data-preview-link` and `data-preview-link="false"` to customize each link
|
266 | 226 | // individually
|
267 | 227 | previewLinks: {{ preview_links }},
|
268 |
| - |
269 | 228 | // Exposes the reveal.js API through window.postMessage
|
270 | 229 | postMessage: {{ post_message }},
|
271 |
| - |
272 | 230 | // Dispatches all reveal.js events to the parent window through postMessage
|
273 | 231 | postMessageEvents: {{ post_message_events }},
|
274 |
| - |
275 | 232 | // Focuses body when page changes visibility to ensure keyboard shortcuts work
|
276 | 233 | focusBodyOnPageVisibilityChange: {{ focus_body_on_page_visibility_change }},
|
277 |
| - |
278 | 234 | // Transition style
|
279 | 235 | transition: {{ transition }}, // none/fade/slide/convex/concave/zoom
|
280 |
| - |
281 | 236 | // Transition speed
|
282 | 237 | transitionSpeed: {{ transition_speed }}, // default/fast/slow
|
283 |
| - |
284 | 238 | // Transition style for full page slide backgrounds
|
285 | 239 | backgroundTransition: {{ background_transition }}, // none/fade/slide/convex/concave/zoom
|
286 |
| - |
287 | 240 | // The maximum number of pages a single slide can expand onto when printing
|
288 | 241 | // to PDF, unlimited by default
|
289 | 242 | pdfMaxPagesPerSlide: {{ pdf_max_pages_per_slide }},
|
290 |
| - |
291 | 243 | // Prints each fragment on a separate slide
|
292 | 244 | pdfSeparateFragments: {{ pdf_separate_fragments }},
|
293 |
| - |
294 | 245 | // Offset used to reduce the height of content within exported PDF pages.
|
295 | 246 | // This exists to account for environment differences based on how you
|
296 | 247 | // print to PDF. CLI printing options, like phantomjs and wkpdf, can end
|
297 | 248 | // on precisely the total height of the document whereas in-browser
|
298 | 249 | // printing has to end one pixel before.
|
299 | 250 | pdfPageHeightOffset: {{ pdf_page_height_offset }},
|
300 |
| - |
301 | 251 | // Number of slides away from the current that are visible
|
302 | 252 | viewDistance: {{ view_distance }},
|
303 |
| - |
304 | 253 | // Number of slides away from the current that are visible on mobile
|
305 | 254 | // devices. It is advisable to set this to a lower number than
|
306 | 255 | // viewDistance in order to save resources.
|
307 | 256 | mobileViewDistance: {{ mobile_view_distance }},
|
308 |
| - |
309 | 257 | // The display mode that will be used to show slides
|
310 | 258 | display: {{ display }},
|
311 |
| - |
312 | 259 | // Hide cursor if inactive
|
313 | 260 | hideInactiveCursor: {{ hide_inactive_cursor }},
|
314 |
| - |
315 | 261 | // Time before the cursor is hidden (in ms)
|
316 | 262 | hideCursorTime: {{ hide_cursor_time }}
|
317 | 263 | });
|
318 |
| - |
319 |
| - {% if data_uri -%} |
320 |
| - // Fix found by @t-fritsch on GitHub |
321 |
| - // see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-6651475. |
322 |
| - function fixBase64VideoBackground(event) { |
323 |
| - // event.previousSlide, event.currentSlide, event.indexh, event.indexv |
324 |
| - if (event.currentSlide.getAttribute('data-background-video')) { |
325 |
| - const background = Reveal.getSlideBackground(event.indexh, event.indexv), |
326 |
| - video = background.querySelector('video'), |
327 |
| - sources = video.querySelectorAll('source'); |
328 |
| - |
329 |
| - sources.forEach((source, i) => { |
330 |
| - const src = source.getAttribute('src'); |
331 |
| - if(src.match(/^data:video.*;base64$/)) { |
332 |
| - const nextSrc = sources[i+1]?.getAttribute('src'); |
333 |
| - video.setAttribute('src', `${src},${nextSrc}`); |
334 |
| - } |
335 |
| - }); |
| 264 | + {% if data_uri %} |
| 265 | + // Fix found by @t-fritsch on GitHub |
| 266 | + // see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-6651475. |
| 267 | + function fixBase64VideoBackground(event) { |
| 268 | + // event.previousSlide, event.currentSlide, event.indexh, event.indexv |
| 269 | + if (event.currentSlide.getAttribute('data-background-video')) { |
| 270 | + const background = Reveal.getSlideBackground(event.indexh, event.indexv), |
| 271 | + video = background.querySelector('video'), |
| 272 | + sources = video.querySelectorAll('source'); |
| 273 | + |
| 274 | + sources.forEach((source, i) => { |
| 275 | + const src = source.getAttribute('src'); |
| 276 | + if(src.match(/^data:video.*;base64$/)) { |
| 277 | + const nextSrc = sources[i+1]?.getAttribute('src'); |
| 278 | + video.setAttribute('src', `${src},${nextSrc}`); |
| 279 | + } |
| 280 | + }); |
| 281 | + } |
336 | 282 | }
|
337 |
| - } |
338 |
| - Reveal.on( 'ready', fixBase64VideoBackground ); |
339 |
| - Reveal.on( 'slidechanged', fixBase64VideoBackground ); |
340 |
| - {%- endif %} |
| 283 | + Reveal.on( 'ready', fixBase64VideoBackground ); |
| 284 | + Reveal.on( 'slidechanged', fixBase64VideoBackground ); |
| 285 | + {% endif %} |
341 | 286 | </script>
|
342 |
| - |
343 |
| - {% if env['READTHEDOCS'] -%} |
344 |
| - <style> |
345 |
| - readthedocs-flyout, readthedocs-notification { |
346 |
| - display: none; |
347 |
| - } |
348 |
| - </style> |
349 |
| - {%- endif %} |
| 287 | + {% if env['READTHEDOCS'] %} |
| 288 | + <style> |
| 289 | + readthedocs-flyout, readthedocs-notification { |
| 290 | + display: none; |
| 291 | + } |
| 292 | + </style> |
| 293 | + {% endif %} |
350 | 294 | </body>
|
351 | 295 | </html>
|
0 commit comments