Skip to contents

Complements 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. FALSE saves style in full instead.

base

Style YAML style is diffed against when deconvolute = TRUE. Defaults to the package's own bundled default.yaml; only worth overriding if style didn't originate from styling_example_style()'s default base either.

Value

The saved content, as a nested list (invisibly).

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")
} # }