diff --git a/NEWS.md b/NEWS.md index 06fd8f6c1..c4661381c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # devtools 1.13.3.9000 +* `build_vignettes()` now has a `clean` and `upgrade` arguments, to control + cleaning of intermediate files and upgrading vignette dependencies + respectively. (#1770). + * `check()` argument `check_version` has been renamed to `remote` to better describe what tests are disabled (#1811) diff --git a/R/vignettes.r b/R/vignettes.r index 8caa91d4d..1a46bfb76 100644 --- a/R/vignettes.r +++ b/R/vignettes.r @@ -10,6 +10,7 @@ #' \code{\link{as.package}} for more information #' @param quiet If \code{TRUE}, suppresses most output. Set to \code{FALSE} #' if you need to debug. +#' @inheritParams tools::buildVignettes #' @inheritParams install_deps #' @keywords programming #' @seealso \code{\link{clean_vignettes}} to remove the pdfs in @@ -18,16 +19,18 @@ #' @seealso \code{\link{clean_vignettes}} to remove build tex/pdf files. build_vignettes <- function(pkg = ".", dependencies = "VignetteBuilder", + clean = TRUE, + upgrade = FALSE, quiet = TRUE ) { pkg <- as.package(pkg) vigns <- tools::pkgVignettes(dir = pkg$path) if (length(vigns$docs) == 0) return() - install_deps(pkg, dependencies, upgrade = FALSE) + install_deps(pkg, dependencies, upgrade = upgrade) message("Building ", pkg$package, " vignettes") - tools::buildVignettes(dir = pkg$path, tangle = TRUE, quiet = quiet) + tools::buildVignettes(dir = pkg$path, clean = clean, tangle = TRUE, quiet = quiet) copy_vignettes(pkg) invisible(TRUE) diff --git a/man/build_vignettes.Rd b/man/build_vignettes.Rd index 2a1d449ef..0de6e3611 100644 --- a/man/build_vignettes.Rd +++ b/man/build_vignettes.Rd @@ -4,7 +4,8 @@ \alias{build_vignettes} \title{Build package vignettes.} \usage{ -build_vignettes(pkg = ".", dependencies = "VignetteBuilder", quiet = TRUE) +build_vignettes(pkg = ".", dependencies = "VignetteBuilder", clean = TRUE, + upgrade = FALSE, quiet = TRUE) } \arguments{ \item{pkg}{package description, can be path or package name. See @@ -14,6 +15,11 @@ build_vignettes(pkg = ".", dependencies = "VignetteBuilder", quiet = TRUE) packages which this \code{pkg} depends on/links to/suggests. See argument \code{dependencies} of \code{\link{install.packages}}.} +\item{clean}{Remove all files generated by the build, even if there + were copies there before.} + +\item{upgrade}{If \code{TRUE}, also upgrade any of out date dependencies.} + \item{quiet}{If \code{TRUE}, suppresses most output. Set to \code{FALSE} if you need to debug.} }