-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Account for child files in Rmd #499
Merged
Merged
Conversation
This file contains 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
This moves some code out of build_markdown so that I can use it in other contexts
If we take the md5 sums of the child files and then use that to provide the hash of hashes before the comparison, then we can get these files to rebuild reliably
This does a few things: 1. The accounting for child documents now occurs right after the intial hashes are taken. 2. We search for child documents only in R Markdown documents 3. We take the hash of the combined hashes of the child documents and the parent file so if one of those hashes changes, then the parent file is rebuilt, but if none change, then the parent file remains. 4. Removes the child file accounting in the comparison step
This will not compute the hash of the hash if there are no child documents
if a config file is edited, then the whole lesson gets rebuilt
This takes care of the situation where a child file could be passed to `build_lesson()` In this case, we need to find the parent file to process it.
Merged
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 will address #497 by allowing child file changes to cause the rebuild of a parent file. This is done in three steps:
rlang::hash()
so if one of those hashes changes, then the parent file is rebuilt, but if none change, then the parent file remains.In addition, this modifies
serve()
andbuild_lesson()
to take into account the situation when someone passes a child file tobuild_lesson()
so that the correct parent file is found to rebuild.To test this locally, with a lesson, you can install it with:
To test this in a live lesson, you can use this in your
config.yaml
To run the development tests, you can use the PR commands from usethis inside the sandpaper repository:
When you are done, run this to get back to the main branch.