Add option to export a single template #407
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains:
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.