Skip to content

Add option to export a single template#407

Open
victor-gp wants to merge 1 commit intosalomonelli:masterfrom
victor-gp:export-single-template
Open

Add option to export a single template#407
victor-gp wants to merge 1 commit intosalomonelli:masterfrom
victor-gp:export-single-template

Conversation

@victor-gp
Copy link
Copy Markdown

@victor-gp victor-gp commented Feb 14, 2022

This PR contains:

  • an opt-in performance optimization

Describe the problem you have without this PR

The export script is very memory-hungry because it creates as many instances of a Chromium browser as there are templates. My laptop doesn't have too much RAM and it often freezes when I run export on this project.

There's room for optimizing that by launching a single instance of Chromium and opening a number of tabs/pages. But in the meantime, here's a pretty simple workaround that allows a single template export by setting an option in the terminal:

npm run export --template=TEMPLATE_NAME

Another benefit of this feature is that you can export only the template you're working on, instead of exporting all and then having to git add the pdf you're interested in, checkout the rest of the pdf dir, etc.

With this change it's possible to export one template instead of the
whole array of them, by running export like this:

$ npm run export --template=TEMPLATE_NAME
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 this pull request may close these issues.

1 participant