astefanutti / decktape

PDF exporter for HTML presentations
MIT License
2.16k stars 175 forks source link

Add secondaryKey option for 2d navigation #291

Closed marwahaha closed 1 year ago

marwahaha commented 1 year ago

fixes #290

For example, my use case is

node decktape.js  --key=ArrowDown automatic 'https://hackmd.io/@kmarw/SJxRLR3DO2?controls=false&fragments=false' ~/test.pdf

There is a bug however; the first slide seems to print twice. Why is this? This happens:

It does not happen

My guess is that it happens when the first key is pressed, and nothing has changed, but perhaps the page is still loading, so isNextSlideDetected is set to true. Just a hypothesis though. (For example, on my slide deck, the first slide advances with the secondaryKey, i.e. the key doesn't advance the slide.)

marwahaha commented 1 year ago

Thanks for the PR. I’m thinking this could be generalized by turning the key option into an array, instead of introducing an ad-hoc ˋsecondary-key` option.

I think this is not that easy; I tried to do this but nomnom's list: true option setting is only parsed when using generic command and not automatic.

marwahaha commented 1 year ago

This seems sort of complicated, and still doesn't fix the bug. Maybe it makes sense to allow the Hackmd plugin on its own.

astefanutti commented 1 year ago

@marwahaha I've created #292, that allows to run:

$ decktape generic 'https://hackmd.io/@kmarw/SJxRLR3DO2?controls=false&fragments=false' test.pdf --key ArrowDown --key ArrowRight

Which produces the following PDF document: test.pdf

marwahaha commented 1 year ago

I think this almost works, but has the same bug I mention (first slide is repeated twice).

astefanutti commented 1 year ago

I've fixed the duplicated first slides issue with 0b69015c99add781ee61519b32f9639c1d1866b7.

I get the following PDF document: test.pdf

Let me know if that works for you.

marwahaha commented 1 year ago

superseded by #292