Skip to content

Commit

Permalink
Merge pull request rstudio#473 from rstudio/aron/knit_params_ask
Browse files Browse the repository at this point in the history
knit_params_ask and render(params=ask)
  • Loading branch information
jjallaire committed Jul 23, 2015
2 parents a1c7ee2 + 4acfa07 commit d2f4573
Show file tree
Hide file tree
Showing 7 changed files with 441 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rmarkdown
Type: Package
Title: Dynamic Documents for R
Version: 0.7.1
Version: 0.7.3
Date: 2015-06-13
Author: JJ Allaire, Jonathan McPherson, Yihui Xie, Hadley Wickham, Joe Cheng,
Jeff Allen
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export(html_vignette)
export(includes)
export(includes_to_pandoc_args)
export(ioslides_presentation)
export(knit_params_ask)
export(knitr_options)
export(knitr_options_html)
export(knitr_options_pdf)
Expand Down
16 changes: 16 additions & 0 deletions R/html_resources.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ discover_rmd_resources <- function(rmd_file, encoding,
discover_render_resource(front_matter[[bibfile]])
}
}

# check for parameter values that look like files.
if (!is.null(front_matter$params)) {
# This is the raw parameter information and has not had any YAML tag
# processing performed. See `knitr:::resolve_params`.
lapply(front_matter$params, function(param) {
if (is.list(param)) {
if (identical(param$input, "file")) {
if (!is.null(param$value)) {
# We treat param filenames as non-web resources.
discover_single_resource(param$value, TRUE, FALSE)
}
}
}
})
}

# check for knitr child documents in R Markdown documents
if (tolower(tools::file_ext(rmd_file)) == "rmd") {
Expand Down
Loading

0 comments on commit d2f4573

Please sign in to comment.