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

Add option to export a single template #407

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

Conversation

victor-gp
Copy link

@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.

None yet

1 participant