Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# devtools (development version)

* `build_site()` now just calls `pkgdown::build_site()`, meaning that you will get more (informative) output by default (#2578).
* New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507)
* `is_loading()` is now re-exported from pkgload (#2556).
* `load_all()` now errors if called recursively, i.e. if you accidentally include a `load_all()` call in one of your R source files (#2617).
Expand Down
32 changes: 7 additions & 25 deletions R/build-site.R
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
#' Execute \pkg{pkgdown} build_site in a package
#' Run `pkgdown::build_site()`
#'
#' `build_site()` is a shortcut for [pkgdown::build_site()], it generates the
#' static HTML documentation.
#' This is a thin wrapper around [pkgdown::build_site()], used for generating
#' static HTML documentation. Learn more at <https://pkgdown.r-lib.org>.
#'
#' @param path path to the package to build the static HTML.
#' @param ... additional arguments passed to [pkgdown::build_site()]
#' @inheritParams install
#'
#' @return NULL
#' @param path Path to the package to build the static HTML.
#' @param ... Additional arguments passed to [pkgdown::build_site()].
#' @export
build_site <- function(path = ".", quiet = TRUE, ...) {
build_site <- function(path = ".", ...) {
rlang::check_installed("pkgdown")

save_all()

pkg <- as.package(path)

check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))

withr::with_temp_libpaths(action = "prefix", code = {
install(pkg = pkg$path, upgrade = "never", reload = FALSE, quiet = quiet)
if (isTRUE(quiet)) {
withr::with_output_sink(
file_temp(),
pkgdown::build_site(pkg = pkg$path, ...)
)
} else {
pkgdown::build_site(pkg = pkg$path, ...)
}
})
pkgdown::build_site(pkg = path, ...)
}
14 changes: 6 additions & 8 deletions man/build_site.Rd

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