From 7bb7b22487fc4bfc7f375aa5080f00ae1bd1fb7e Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Wed, 21 Jan 2026 13:07:32 -0600 Subject: [PATCH] Simplify `build_site()` Fixes #2578 --- NEWS.md | 1 + R/build-site.R | 32 +++++++------------------------- man/build_site.Rd | 14 ++++++-------- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9c2d1d782..8a39da72c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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). diff --git a/R/build-site.R b/R/build-site.R index 9935963c3..8b66bda52 100644 --- a/R/build-site.R +++ b/R/build-site.R @@ -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 . #' -#' @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, ...) } diff --git a/man/build_site.Rd b/man/build_site.Rd index c56cdcc03..0d3a08809 100644 --- a/man/build_site.Rd +++ b/man/build_site.Rd @@ -2,18 +2,16 @@ % Please edit documentation in R/build-site.R \name{build_site} \alias{build_site} -\title{Execute \pkg{pkgdown} build_site in a package} +\title{Run \code{pkgdown::build_site()}} \usage{ -build_site(path = ".", quiet = TRUE, ...) +build_site(path = ".", ...) } \arguments{ -\item{path}{path to the package to build the static HTML.} +\item{path}{Path to the package to build the static HTML.} -\item{quiet}{If \code{TRUE}, suppress output.} - -\item{...}{additional arguments passed to \code{\link[pkgdown:build_site]{pkgdown::build_site()}}} +\item{...}{Additional arguments passed to \code{\link[pkgdown:build_site]{pkgdown::build_site()}}.} } \description{ -\code{build_site()} is a shortcut for \code{\link[pkgdown:build_site]{pkgdown::build_site()}}, it generates the -static HTML documentation. +This is a thin wrapper around \code{\link[pkgdown:build_site]{pkgdown::build_site()}}, used for generating +static HTML documentation. Learn more at \url{https://pkgdown.r-lib.org}. }