Skip to content

Commit

Permalink
Add clean and upgrade arguments to build_vignettes
Browse files Browse the repository at this point in the history
Fixes #1770
  • Loading branch information
jimhester committed Jul 18, 2018
1 parent 34940e8 commit eb67462
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
7 changes: 5 additions & 2 deletions R/vignettes.r
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion man/build_vignettes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb67462

Please sign in to comment.