damianavila / RISE

RISE: "Live" Reveal.js Jupyter/IPython Slideshow Extension
Other
3.67k stars 414 forks source link

How to show two cells at once, without fragments? #593

Closed drscotthawley closed 3 years ago

drscotthawley commented 3 years ago

(This is a cross-post and elaboration of the question I asked on Gitter:) Wonderful utility RISE is!

There's something I'm not understand, and not seeing described in the documentation: How do we get two or more cells to appear at the same time on the same slide, without having to advance through fragments?

Most of my slides are two parts, from two cells: A Markdown header with the slide title and a bit of text, and then below that a figure (picture/chart) generated by a code cell.

Currently I'm setting the Markdown header as "slide" and the code cell as "fragment", but that means that I always have to press the space bar to reveal the slide and -- more importantly -- the "w" overview doesn't show any of my figures, making it harder to navigate.

How can we get two cells to display at the same time without having to step through "fragments"? Perhaps there's an "auto-advance fragments" customization? (but I didn't see any such thing mentioned. )

(Or, I'd settle for fragments displaying in overview if not in the main-display mode.)

drscotthawley commented 3 years ago

From this reveal.js issue https://github.com/hakimel/reveal.js/issues/1784, it's possible to have it auto-show the first fragment (good enough for me!) by adding this to a "skipped" code cell at the top:

%%html
<script>
Reveal.addEventListener( 'slidechanged', function( event ) {
    Reveal.nextFragment();
} );
</script>

...this works! Closing.

drscotthawley commented 3 years ago

...I spoke too soon. That seems to work some of the time, but it's intermittent. Some first fragments auto-show, others don't and you still have to press the space bar to see them. The intermittancy seems to be from errors in the (Brave) browser:

Uncaught ReferenceError: Reveal is not defined
    at <anonymous>:2:1
    at b (main.min.js:2)
    at Pe (main.min.js:2)
    at S.fn.init.append (main.min.js:2)
    at OutputArea._safe_append (main.min.js:35319)
    at OutputArea.append_display_data (main.min.js:35526)
    at OutputArea.append_output (main.min.js:35206)
    at OutputArea.handle_output (main.min.js:35117)
    at output (main.min.js:36943)
    at Kernel._handle_output_message (main.min.js:38704)

Update: Think I might have figured out a process that works:

  1. Start the slideshow
  2. Exit the slideshow
  3. Then execute the HTML/javascript to add the event listener
  4. Re-run the slideshow. Now the first fragments will autoload.

If you ever reload the browser page serving the notebook, you'll need to repeat this process.

parmentelat commented 3 years ago

As mentioned on gitter, just don't add fragments at all and iiuc you will get the behavior that you want

drscotthawley commented 3 years ago

@parmentelat Thank you! Closing.