-
Notifications
You must be signed in to change notification settings - Fork 183
Description
First of all, thanks for maintaining this! It seems I'm close to have a working setup, but I'm hitting some walls.
I'm running jupyterlab 4.1.2 with the jupyterlab_rise 0.42.0 plugin. I understand that this is not the original RISE that the decktape plugin was developed for, but I am hoping to make it work.
What I encountered so far:
- Running
decktape rise URL PDF
gave me "Error: Could not find Chrome (ver. 122.0.6261.69)." with the hint to runnpx puppeteer browsers install chrome
. I did, which installed Chrome 122.0.6261.111, as I could tell from the puppeteer cache directory. The version is close enough, I figured that I can force decktape to use that one withPUPPETEER_BROWSER_REVISION=122.0.6261.111 decktape rise URL PDF
. - Running
jupyter notebook
and thendecktape rise http://localhost:8888/notebooks/path/file.ipynb?token=... outfile.pdf
gives:I suspect this is because the selectors in rise.js do not work for the jupyterlab_rise plugin. There's not much use to go down this route for now, because even manually, I cannot start a presentation from there -- it does not start to render, which I blame on jupyterlab_rise.Error: Unable to activate the RISE DeckTape plugin for the address: http://localhost:8888/notebooks/01%20introduction/presentation-2024.ipynb?token=8b5c8273a0f373af642e1c43b32bd038900a77706e215cae at createPlugin (file:///usr/lib/node_modules/decktape/decktape.js:341:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
- Running
jupyter lab
and thendecktape --load-pause=20000 --headless=false generic 'http://localhost:8888/lab?token=...
opens jupyter lab in the puppeteer-controlled Chromium and gives me 20 seconds to start the presentation in full screen mode and adjust the zoom level. Then the plugin prints the first slide, switches to the second slide, and stops. It says "Printed 1 slides" and seems happy with it. Even when specifying--slides=1-22
it will only print the first slide. Fromgeneric.js
, I can see that it is supposed to track changes to the DOM. In Reveal, as far as I understood, the changes are limited to some CSS classes being set or unset for some<section>
elements. Is it possible that these changes go undetected? If I just add aminSlides
option togeneric.js
that allows me to enforce a minimum number of exported slides, am I set? 🤔
/edit: Ok, the minSlides option actually works, it was easier than expected. Would still be interesting to investigate why the generic plugin does not detect the changes. Another interesting take for me would be to have a plugin that waits for a specific keypress from me to take a screenshot of the current slide, and another that signals the end of the presentation.
/edit: The generic plugin does not detect the changes because the presentation is embedded in an iframe. Luckily the URL of the iframe is predictable, so we can do:
- Run
jupyter lab
and thendecktape generic 'http://localhost:8888/rise/path/file.ipynb?token=...
. This even works in headless mode. It has the opposite problem that the printing of pages never stops, but this can be fixed with--max-slides
. Even more elegantly, we can just check whetherwindow.location.hash
changed; I will write a plugin for that.