Skip to content

simple feature request: add option "clean" (and "upgrade"?) to build_vignettes #1770

@courtiol

Description

@courtiol

Hi all,
build_vignettes() is great but for some utilisation, it is a little frustrating to see the knitr cash removed after building vignettes that take hours to be processed. It would be great and easy to offer this option.

Proposition:

build_vignettes <- function(pkg = ".",
                            dependencies = "VignetteBuilder",
                            clean = FALSE,  ## new
                            quiet = TRUE
                            ) {
  pkg <- as.package(pkg)
  vigns <- tools::pkgVignettes(dir = pkg$path)
  if (length(vigns$docs) == 0) return()

  install_deps(pkg, dependencies, upgrade = FALSE)

  message("Building ", pkg$package, " vignettes")
  tools::buildVignettes(dir = pkg$path, clean = clean, tangle = TRUE, quiet = quiet)  ## clean added
  copy_vignettes(pkg)

  invisible(TRUE)
}

and since we are at it a boolean argument "upgrade" to pass to the function install_deps() could be nice.

I implement that with the documentation and send a pull request, but I wanted to probe the terrain first.
++

Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions