Performs routine package maintenance:
Clean
DESCRIPTIONwithusethis::use_tidy_description().Compress data in the
"./data"and"./R"paths usingtools::resaveRdaFiles().Style code with
styler::style_pkg().Check URLs with
urlchecker::url_check().Roxygenize with
roxygen2::roxygenise().Precompute vignettes with
precompute_vignette_all()if present.Rebuild
README.qmd,README.Rmdor pkgdown index files, if present.Optimize images with
resmush::resmush_dir().Write
codemeta.jsonwithcodemetar::write_codemeta().Write
CITATION.cffwithcffr::cff_write().Write a project-level Codex configuration file.
Usage
update_docs(
pkg = ".",
url_update = TRUE,
create_codemeta = TRUE,
create_cff = TRUE,
build_readme = TRUE,
verbose = TRUE,
precompute = TRUE,
opt_imgs = TRUE,
opt_dir = c("man/figures", "vignettes"),
opt_ext = "png$|jpg$",
opt_overwrite = TRUE,
add_contributors = TRUE,
...
)Arguments
- pkg
Path to the package root directory.
- url_update
A logical value. Should URLs be updated with
urlchecker::url_update()?- create_codemeta
A logical value. Should
codemeta.jsonbe created withcodemetar::write_codemeta()?- create_cff
A logical value. Should
CITATION.cffbe created withcffr::cff_write()?- build_readme
A logical value. Should
README.qmd,README.Rmdor pkgdown index files be built?- verbose
A logical value. Should progress messages be displayed in the console?
- precompute
A logical value. Should vignettes be detected and precomputed? See also
precompute_vignette_all().- opt_imgs
A logical value. Should images be optimized with
resmush::resmush_dir()?- opt_dir, opt_ext, opt_overwrite
Options passed to the
dir,extandoverwritearguments ofresmush::resmush_dir().- add_contributors
Deprecated.
- ...
Additional arguments passed to downstream functions.
Value
NULL, invisibly, after updating the package.
Emits progress messages when verbose = TRUE.
Details
This function checks URLs, regenerates roxygen2 documentation and rebuilds
the README. It also applies the tidyverse style to DESCRIPTION
and package code and writes package metadata to codemeta.json.
See also
build_qmd()builds Quarto files.build_readme_qmd()buildsREADME.mdfromREADME.qmd.check_rd_titles()checks generated Rd titles.gha_update_docs()automates this workflow with GitHub Actions.precompute_vignette_all()precomputes all vignette source files.devtools::build_readme()buildsREADME.Rmdfiles.
Package maintenance helpers:
add_global_gitgnore()
