pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

Standard helper for extracting options from _pkgdown.yaml

Open hadley opened this issue 4 years ago • 4 comments

Should include default value, and provide list of keys, where everything apart from the first key is treated as a deprecated, and generates an deprecation message.

hadley avatar Nov 30 '21 13:11 hadley

Could also do some type checking?

hadley avatar May 31 '22 22:05 hadley

Look for uses of check_yaml_has and pkgdown_config_href

Actually pkgdown_field() looks more reliable.

hadley avatar May 01 '24 01:05 hadley


config_markdown_inline(pkg, path)
config_markdown_block(pkg, path)
config_string(pkg, path)
config_list(pkg, path)
config_character(pkg, path)

config_exclusive(pkg, path1, path2) #?

check_yaml_has() goes away; it's replaced by config_string() in data_home_component(), and the remaining use can be inlined.

Maybe config_pluck_string()?

hadley avatar May 01 '24 20:05 hadley

  • Need to create new utils-config.R (or maybe just config.R?)
  • All config() functions should have call arg
  • Look at other uses of pluck() and $
  • config_pluck_bool()?
  • How to handle defaults/deprecation fallbacks. Maybe that's easy because there no required values? That's not completely true, but all the required values are nested in other top-level values?
  • Instead of config_pluck_list() maybe config_pluck_struct() and config_pluck_array_of_structs()? (With better names)

hadley avatar May 03 '24 04:05 hadley