apiad / auditorium

An HTML+CSS+JS generator from pure Python code
https://apiad.net/auditorium
81 stars 13 forks source link

Adds support for Issue #54 , automatically scroll through slides with configurable timeout #55

Closed qharlie closed 2 years ago

qharlie commented 3 years ago

Here is the initial pull request. The slides will auto scroll but the play/pause button doesn't show up when just setting it on the Slides.

UPDATED:

I've added a parameter to the Show ( Show.autoslide ) class that will set the default revealjs-autoslide interval if not specified at the Slide level, if the Slide autohide constructor parm is set it will use that , if neither is specified autoslide is not enabled.

This required moving Reveal.initialize() js code into Show._generate_init_js() which generates the js code and inserts into static.html and dynamic.html

WAS:

Without the init parameter ( autoSlide: 10000 ) to Reveal.initialize() ( https://revealjs.com/auto-slide/ ) which is currently hardcoded in the html templates, that the Pause/Play icon doesn't appear when auto-sliding. I'm thinking we could add a param to the Show class called autoslide=True|False, then make Render.initialize a text variable called render_initialize and pass it to the render functions self._template_static.render... , self._template_dynamic.render... , etc , where we set that param explicitly if the Show class has autoslide parameter set, and add entries for them

<script>{{ render_initialize | safe }} </script>

in the html files .

Thoughts ?

apiad commented 3 years ago

Thanks! This looks pretty nice. I'll pull it and try it on my own as soon as I have a minute! This is a feature I really wanted to have since day one :)