
Save a (possibly edited) style list as an override YAML
Source:R/save-overrides.R
styling_save_overrides.RdComplements styling_example_style(): edit its returned list in
place, then save just what changed back out as an override
YAML, ready to pass as override/--override to
styling_build_reference_docx() or any other styling_*() function
that takes one.
Usage
styling_save_overrides(
style,
file = "overrides.yaml",
overwrite = FALSE,
deconvolute = TRUE,
base = system.file("python", "styles", "default.yaml", package = "quartifyr")
)Arguments
- style
The (possibly edited) style list, typically
styling_example_style()'s return value after in-place edits.- file
Destination path for the override YAML.
- overwrite
Replace the destination if it already exists.
- deconvolute
Save only the keys that differ from
base(the default) – an override meant to be deep-merged back onto that same base at load time, not a second full style YAML to keep in sync by hand.FALSEsavesstylein full instead.- base
Style YAML
styleis diffed against whendeconvolute = TRUE. Defaults to the package's own bundleddefault.yaml; only worth overriding ifstyledidn't originate fromstyling_example_style()'s defaultbaseeither.
Examples
if (FALSE) { # \dontrun{
# Requires a provisioned quartifyr Python environment (see
# initialize_quartifyr_project()).
style <- styling_example_style("path/to/project")
style$page$margins_in$top <- 1.25
styling_save_overrides(style, file = "overrides.yaml")
} # }