
Render a Whole Folder of Reports Once per Parameter Set
Source:R/render_parameterized_study.R
render_parameterized_study.Rd[render_parameterized_pair()] for a folder: every `.qmd`/`.Rmd` file in `source_dir` is rendered once per entry of `param_list`, and the outputs of entry `i` go to `target_dirs[i]`. This replaces keeping a mirrored copy of the folder (for example `compute_index/` and `compute_index_impute/`) that differs only in a few parameters. The templates themselves are never copied or changed.
Usage
render_parameterized_study(
source_dir,
target_dirs,
param_list,
pattern = "\\.(qmd|Rmd)$",
recursive = FALSE,
formats = "html",
on_error = c("continue", "stop"),
dry_run = FALSE,
...
)Arguments
- source_dir
Folder with the templates.
- target_dirs
Output folders, one per parameter set (created if missing). Unnamed or named.
- param_list
A list of named parameter lists, the same length as `target_dirs`.
- pattern
Regular expression for the files to render (default `"\.(qmd|Rmd)$"`, ignoring case).
- recursive
Also look in sub-folders (default `FALSE`).
- formats
Output formats (default `"html"`).
- on_error
`"continue"` (default; failures are reported in the result) or `"stop"`.
- dry_run
Plan only; nothing is rendered.
- ...
Further arguments for [render_variants()] (`self_contained`, `check_params`, `renderer`, `quiet`).
Value
A tibble, one row per document, parameter set and format, with the columns of [render_variants()] plus `document` and `target_dir`.