-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix(render): Rerender also when child files changes #158
Conversation
Currently, a knitr/rmarkdown report is only rerun if a) dependent targets change, b) output files in the e.g. main_files directory (created by knitr), or c) the main file of the report changes. However, if the text of a child document changes, a rerun is also desired. Thus, the current commit adds the child files of a report to the return value and thus, checking these files for changes.
I am open to including the sources of child documents, but as you have seen, it can be hard to detect them. I think it would be better to Also, it would be great to try to avoid modifying the tests more than needed. I think we only need one child file to test this. We would also need to make the same changes for |
Thank you for your feedback! I'm sorry, it will take me some days to work again on this PR. |
No worries. In fact, I hope you didn't get too far ahead because I no longer think it is feasible for |
I agree with you that is hard for However, I think that the detection of these three inclusions ( As an alternative, it could be an option to manually add child documents as a dependency to the In my analysis, I have always a main rmarkdown document that includes several child documents. Currently, it is very annoying to invalidate the Thanks again for your help and considering these options. |
I think it would be best if the |
Prework
Related GitHub issues and pull requests
Summary
Please explain the purpose and scope of your contribution.
Currently, a knitr/rmarkdown report is only rerun if a) dependent targets change, b) output files in the e.g.
main_files
directory (created by knitr if the output file is calledmain
), or c) the main (source) file of the report changes. However, if the text of a child document changes, a rerun is also desired.Thus, the current commit adds the child files of a report to the return value and thus, checking these files for changes.
Remarks
stringr
package but I didn't want to add an extra dependency for such a small change. I also used the|>
and\(x)
operators here. I don't mind to change these if you don't like them. I'm also happy about any changes and improvements you propose.knitr_lines
what is probably not desired. However, I think the current changes were the simplest one even though an overhead is added.source(file.R)
commands are not detected.tar_render_paths
the return files are sorted,output
andsource
as well. Howeveroutput
andsource
should be of length 1. Thus, is it safe to omit thesort
function?Thanks for your feedback!