-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Change cache.extra to be a per chunk option #405
Conversation
Changes cache.extra to the be a per chunk option rather than a package option. This allows you to set a particular chunk's cache to be invalidated if the modification time of the file is updated for instance, among numerous other uses. The previous behavior can still be used by specifying the cache.extra chunk option in the first chunk to make it the default, as with the regular cache option. Fixes yihui#404
I think this makes sense and will accept it tomorrow. Thanks! |
Is there anything else you would like changed with this pull request before accepting it yihui? |
No, I leave it open just to remind myself to update the website accordingly. |
Change cache.extra to be a per chunk option (fixed #404)
@@ -53,7 +53,7 @@ call_block = function(block) { | |||
# Check cache | |||
if (params$cache) { | |||
content = list(params[setdiff(names(params), 'include')], getOption('width')) | |||
content[[3L]] = eval_lang(opts_knit$get('cache.extra')) | |||
content[[3L]] = eval_lang(opts_chunk$get('cache.extra')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a matter of fact, this line is no longer necessary because all chunk options have been evaluated before, including cache.extra
Changes cache.extra to the be a per chunk option rather than a package option.
This allows you to set a particular chunk's cache to be invalidated if the
modification time of the file is updated for instance, among numerous other
uses. The previous behavior can still be used by specifying the cache.extra
chunk option in the first chunk to make it the default, as with the regular
cache option. Fixes #404