From 8aab3b5e44e6efd97b95bbe58beb930b054e89fa Mon Sep 17 00:00:00 2001 From: Alexander Rossell Hayes Date: Mon, 19 Feb 2024 16:25:05 -0800 Subject: [PATCH] docs(check_always): use a fake example so that output looks correct on pkgdown site --- R/check_always.R | 9 ++++++++- man/check_always.Rd | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/R/check_always.R b/R/check_always.R index ecfb3a3..51ee145 100644 --- a/R/check_always.R +++ b/R/check_always.R @@ -21,12 +21,19 @@ nice_callback <- function(expr, value, ok, visible) { #' #' @export #' -#' @examples +#' @section Examples: +#' ```r #' check_always() +#' #> Now checking whether all output is nice #' 23 * 3 +#' #> [1] 69 +#' #> Nice! #' #' uncheck_always() +#' #> No longer checking whether all output is nice #' 23 * 3 +#' #> [1] 69 +#' ``` check_always <- function(verbose = TRUE) { if ("nice_callback" %in% getTaskCallbackNames()) { if (isTRUE(verbose)) message("Already checking whether all output is nice") diff --git a/man/check_always.Rd b/man/check_always.Rd index beb4a63..9795658 100644 --- a/man/check_always.Rd +++ b/man/check_always.Rd @@ -20,11 +20,20 @@ to check whether all R output is nice. \code{uncheck_always()} disables the task callback function, returning your R session to normal behavior. } -\examples{ -check_always() +\section{Examples}{ + + +\if{html}{\out{
}}\preformatted{check_always() +#> Now checking whether all output is nice 23 * 3 +#> [1] 69 +#> Nice! uncheck_always() +#> No longer checking whether all output is nice 23 * 3 +#> [1] 69 +}\if{html}{\out{
}} } + \keyword{nice}