#' @noRd
.display_info <- function(x, ..., .envir = parent.frame(), .verbose = .get_verbose(), .f_glue = glue::glue_collapse) {
if (!.verbose) {
return(invisible(x))
}
x <- .f_glue(x, '\n')
x <- glue::glue(x, .envir = .envir)
cli::cat_line(x)
}
#' @noRd
.display_warning <- function(x, ..., .envir = parent.frame()) {
x <- glue::glue_collapse(x, '\n')
x <- glue::glue(x, .envir = .envir)
warning(x, call. = FALSE, immediate. = TRUE)
}
#' @noRd
.display_error <- function(x, ..., .envir = parent.frame()) {
x <- glue::glue_collapse(x, '\n')
x <- glue::glue(x, .envir = .envir)
cnd <- structure(class = c('usethis_error', 'error', 'condition'), list(message = x))
stop(cnd)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.