Add option to export a single template#407
Open
victor-gp wants to merge 1 commit intosalomonelli:masterfrom
Open
Add option to export a single template#407victor-gp wants to merge 1 commit intosalomonelli:masterfrom
victor-gp wants to merge 1 commit intosalomonelli:masterfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_NAMEAnother 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 addthe pdf you're interested in,checkoutthe rest of the pdf dir, etc.