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 backends to cache previous results #985

Merged
merged 4 commits into from
Aug 7, 2019

Conversation

Michael-F-Bryan
Copy link
Contributor

This is something that came up in my rewrite of mdbook-linkcheck (Michael-F-Bryan/mdbook-linkcheck#11). I'd implemented a cache so we don't execute lots of slow web requests too frequently, and found that the cache file didn't exist every time the mdbook-linkcheck backend was invoked.

We probably want to let backends cache previous results. This PR removes the call to utils::fs::remove_dir_content(&build_dir) in MDBook::build() and makes sure the the HTML renderer manually cleans its destination directory.

I've also updated the user-docs to mention this.

@ehuss
Copy link
Contributor

ehuss commented Aug 7, 2019

I think I understand this, and it does seem to make sense. It was already documented in the paragraph above that it may exist for caching, though emphasizing it twice doesn't hurt. 😉

@sytsereitsma
Copy link

Deleting the book dir also removes any files written to the book output directory by preprocessors, which seems a bit too rigorous. See issue #1087

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.

3 participants