Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting a jupyterlab_rise presentation #325

Open
f0k opened this issue Mar 27, 2024 · 0 comments · May be fixed by #326
Open

Converting a jupyterlab_rise presentation #325

f0k opened this issue Mar 27, 2024 · 0 comments · May be fixed by #326

Comments

@f0k
Copy link

f0k commented Mar 27, 2024

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 run npx 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 with PUPPETEER_BROWSER_REVISION=122.0.6261.111 decktape rise URL PDF.
  • Running jupyter notebook and then decktape rise http://localhost:8888/notebooks/path/file.ipynb?token=... outfile.pdf gives:
    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)
    
    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.
  • Running jupyter lab and then decktape --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. From generic.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 a minSlides option to generic.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 then decktape 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 whether window.location.hash changed; I will write a plugin for that.
@f0k f0k linked a pull request Mar 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant