Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Experimental: add an export npm script #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nb
Copy link
Member

@nb nb commented Jan 20, 2020

Quite hacky at this point, though the script was successfully used to export few presentations I had.

Approach: uses puppeteer to open a URL and press Space, while taking
screenshots. We assume that at each transition the URL changes. Once it
stops changing, we assume there are no more slides.

Plenty of problems:

  • requires node;
  • assumes that the URL is visible without authentication and from the environment we are running the script from (there can be proxies, etc.);
  • no error handling – not sure what will happen if something breaks;
  • the assumption that the URL will change quickly enough is weak, I can see how it either finish too early or lead to an infinite loop. Knowing the number of slides in advance will be better;
  • assumes we have less than 1000 slides, so that we can take care of padding in file names. Seems the safest assumption compared to the ones above :) Can be lifted if we know the number of slides in advance;
  • Used local prettier rules, didn't setup the WordPress rules for now;
  • Resolution is hard-coded at Full HD – 1920:1080. Quite typical projector resolution these days.

I am posting more to start discussion and as a starting point than an attempt to merge it. Also curious how did you handle exporting State of the Word presentation.

Quite hacky at this point, though works.

Approach: uses puppeteer to open a URL and press Space, while taking
screenshots. We assume that at each transition the URL changes. Once it
stops changing, we assume there are no more slides.

Plenty of problems:
- requires `node`;
- assumes that the URL is visible without authentication and from the
environment we are running the script from (there can be proxies, etc.);
- no error handling – not sure what will happen if something breaks;
- the assumption that the URL will change quickly enough is weak, I can
see how it either finish too early or lead to an infinite loop. Knowing
the number of slides in advance will be better;
- assumes we have less than 1000 slides, so that we can take care of
padding in file names. Seems the safest assumption compared to the ones
above :) Can be lifted if we know the number of slides in advance;
- Resolution is hard-coded at Full HD – 1920:1080. Quite typical
projector resolution these days.
@nb nb changed the title Experimental: add an export npm script Experimental: add an export npm script Jan 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant