From 6f6565b5dc30769cab9cb58791e2c6ab5aa83f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 27 Jun 2024 19:46:50 +0200 Subject: [PATCH] docs: Only implement `type_sum.accel()` in pkgdown mode --- R/type.R | 5 ----- R/zzz.R | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) 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