You can use this function to format a line of cli text, without emitting it to the screen. It uses cli_text() internally.

format_inline(..., .envir = parent.frame())

Arguments

...

Passed to cli_text().

.envir

Environment to evaluate the expressions in.

Value

Character scalar, the formatted string.

Examples

format_inline("This is a message for {.emph later}.")
#> [1] " This is a message for \033[3m\033[3mlater\033[3m\033[23m."