Run routine checks on the package:
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, if present (see https://ropensci.org/blog/2019/12/08/precompute-vignettes/).
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 a (subdirectory of an) R package.
- 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 informative messages be displayed on the console?
- precompute
A logical value. Should vignettes be detected and precomputed? See also
precompute_vignette().- 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.
Details
This function updates and cleans the package using a mix of best practices,
such as checking URLs, roxygenizing and rebuilding the README. It also
applies discretionary practices such as the tidyverse approach for the
DESCRIPTION file, overall code style and codemeta.json.
See also
add_global_gitgnore()updates package ignore files.build_qmd()builds Quarto files.check_rd_titles()checks generated Rd titles.precompute_vignette()precomputes vignettes.usethis::use_tidy_description()cleansDESCRIPTION.styler::style_pkg()styles package code.urlchecker::url_check()checks URLs.roxygen2::roxygenise()updates documentation.devtools::build_readme()buildsREADME.Rmdfiles.codemetar::write_codemeta()writescodemeta.json.tools::resaveRdaFiles()compresses data files.
Package maintenance helpers:
add_global_gitgnore()
