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

Allow preprocessors to pass generated resources (fix issue #1087) #1341

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sytsereitsma
Copy link

The problem it solves (#1087) is that some preprocessors actually generate files that need to be staged somewhere. I used to copy them directly to the book output dir, but the HBS rederer now removes the book output dir after the preprocessor has been executed (introduced with #985). Apart from that, copying the files to the book output dir will probably only work for the HBS renderer.

To overcome the above problem I have added a resource list to the Chapter struct. Renderers can read the extra resource data from there and process it as they see fit.

I do think the handles_book_resources test (hbs_renderer.rs:1131) may be a bit brittle. The render function does not really lend it self for unit testing.

@sytsereitsma
Copy link
Author

sytsereitsma commented Sep 28, 2020

@ehuss This is the alternative solution using the book as single source of truth as @Michael-F-Bryan suggested (PR 1144)

Should you prefer this solution over the other, than PR 1144 can be deleted. No hard feelings :-)

@sytsereitsma
Copy link
Author

@ehuss A gentle reminder

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