Revision df465aa02367bc8bf2fa3f2e3827be5f8713569a authored by Hadley Wickham on 03 December 2021, 09:00:02 UTC, committed by cran-robot on 03 December 2021, 09:00:02 UTC
1 parent be39bf7
pkgdown.R
#' @importFrom magrittr %>%
#' @importFrom utils installed.packages
#' @import rlang
#' @import fs
#' @keywords internal
"_PACKAGE"
release_bullets <- function() {
c(
"Check that 'test/widget.html' responds to mouse clicks"
)
}
#' Determine if code is executed by pkgdown
#'
#' This is occasionally useful when you need different behaviour by
#' pkgdown and regular documentation.
#'
#' @export
#' @examples
#' in_pkgdown()
in_pkgdown <- function() {
identical(Sys.getenv("IN_PKGDOWN"), "true")
}
local_envvar_pkgdown <- function(pkg, scope = parent.frame()) {
withr::local_envvar(
IN_PKGDOWN = "true",
LANGUAGE = pkg$lang,
.local_envir = scope
)
}
local_pkgdown_site <- function(path, meta = NULL, env = parent.frame()) {
if (!is.null(meta)) {
meta <- yaml::yaml.load(meta)
} else {
meta <- list()
}
pkg <- as_pkgdown(path, meta)
clean_up <- function(path) {
if (!fs::dir_exists(path)) {
return()
}
fs::dir_delete(path)
}
if (pkg$development$in_dev) {
withr::defer(clean_up(path_dir(pkg$dst_path)), envir = env)
} else {
withr::defer(clean_up(pkg$dst_path), envir = env)
}
pkg
}

Computing file changes ...