Internal function needed for tar_quarto().
Users should not invoke it directly.
Arguments
- args
A named list of arguments to
quarto::quarto_render().- deps
An unnamed list of target dependencies of the Quarto source files.
- sources
Character vector of Quarto source files.
- output
Character vector of Quarto output files and directories.
- input
Character vector of non-source Quarto input files and directories.
Value
Sorted character vector with the paths to all the important
files that targets should track for changes.
Examples
if (identical(Sys.getenv("TAR_LONG_EXAMPLES"), "true")) {
targets::tar_dir({ # tar_dir() runs code from a temporary directory.
# Unparameterized Quarto document:
lines <- c(
"---",
"title: Quarto source file",
"output_format: html",
"---",
"Assume these lines are in the Quarto source file.",
"```{r}",
"1 + 1",
"```"
)
tmp <- tempfile(fileext = ".qmd")
writeLines(lines, tmp)
args <- list(input = tmp, quiet = TRUE)
files <- fs::path_ext_set(tmp, "html")
tar_quarto_run(args = args, deps = list(), files = files)
file.exists(files)
})
}