astefanutti / decktape

PDF exporter for HTML presentations
MIT License
2.19k stars 176 forks source link

Grunt task #193

Open rombert opened 5 years ago

rombert commented 5 years ago

It would be useful to have a grunt task for Decktape. I'll describe my scenario below ( which is admittedly a bit exotic ) but on the other hand others may have a use for it as well.

I am generating my presentations using reveal.js and have a single repository for all presentations:

/shared
  /reveal.js-support
    /package.json
    /gruntfile.shared.js
/2019
  /conf-1
    /pres-1
      /package.json
      /index.html
    /pres-2
      /package.json
      /index.html
  /conf-2
    /pres-3
      /package.json
      /index.html  

Each of the presentations has a minimal package.json which calls grunt with the Gruntfile from /shared/reveal.js-support/gruntfile.shared.js, e.g.

  "scripts": {
    "build": "grunt --gruntfile ../../../shared/reveal.js-support/gruntfile.shared.js"
  }

This works pretty well and in general can add a new presentation with minimal boilerplate and only the grunt-cli dev dependency.

Since adding decktape as a dev dependency each presentation has about 340 MB extra in its node_modules directory, which is significant. I would like to avoid that. I have considered using npm install -g decktape, but it's non-portable and polutes the system area.

Adding a decktape grunt task would allow me move the decktape dependency to the shared file.

And I am sure there may be other reasons for using a grunt task as opposed to calling decktape directly :-)