diff --git a/R/type.R b/R/type.R index 656d9d8a3..0bb50dabf 100644 --- a/R/type.R +++ b/R/type.R @@ -94,11 +94,6 @@ format_type_sum <- function(x, width, ...) { UseMethod("format_type_sum") } -# https://github.com/r-lib/pkgdown/issues/1540 -type_sum.accel <- function(x) { - I("kg m/s^2") -} - #' @export #' @rdname format_type_sum format_type_sum.default <- function(x, width, ...) { diff --git a/R/zzz.R b/R/zzz.R index 3fbf937c4..5e739e095 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -36,6 +36,13 @@ #' @importFrom cli symbol NULL +# https://github.com/r-lib/pkgdown/issues/1540 +if (Sys.getenv("IN_PKGDOWN") != "") { + type_sum.accel <- function(x) { + I("kg m/s^2") + } +} + # nolint start .onLoad <- function(libname, pkgname) { # nolint end