R/utils-format-message.R

Defines functions format_code format_todo format_value

Documented in format_code format_todo format_value

#' Format content as a variable value
#'
#' @param ... strings
#' @return a formatted string to output
#'
#' @export
format_value <- function(...)
{
    x <- paste0(..., collapse = "")
    x <- encodeString(x, quote = "'")
    crayon::blue(x)
}

#' Format content as an action to be performed by the user
#'
#' @param ... strings
#' @return a formatted string to output
#'
#' @export
format_todo <- function(...)
{
    paste0(crayon::red(clisymbols::symbol$bullet), " ", ..., collapse = "")
}

#' Format content as code
#'
#' @param ... strings
#' @return a formatted string to output
#'
#' @export
format_code <- function(...)
{
    x <- paste0(..., collapse = "")
    x <- encodeString(x, quote = "`")
    crayon::silver(x)
}

Try the portalr package in your browser

Any scripts or data that you put into this service are public.

portalr documentation built on Dec. 11, 2021, 10:02 a.m.