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

Change cache.extra to be a per chunk option #405

Merged
merged 1 commit into from
Oct 25, 2012

Conversation

jimhester
Copy link
Contributor

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

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
@yihui
Copy link
Owner

yihui commented Oct 19, 2012

I think this makes sense and will accept it tomorrow. Thanks!

@jimhester
Copy link
Contributor Author

Is there anything else you would like changed with this pull request before accepting it yihui?

@yihui
Copy link
Owner

yihui commented Oct 25, 2012

No, I leave it open just to remind myself to update the website accordingly.

yihui added a commit that referenced this pull request Oct 25, 2012
Change cache.extra to be a per chunk option (fixed #404)
@yihui yihui merged commit 31b9c2c into yihui:master Oct 25, 2012
@@ -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'))
Copy link
Owner

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

yihui added a commit that referenced this pull request Oct 25, 2012
yihui added a commit that referenced this pull request Oct 25, 2012
yihui added a commit that referenced this pull request Oct 12, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cache.extra should be a per chunk option rather than a package option
2 participants