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.

Details

format_inline() performs no width-wrapping.

Examples

format_inline("A message for {.emph later}, thanks {.fn format_inline}.")
#> [1] "A message for \033[3mlater\033[23m, thanks \033[38;5;235m\033[48;5;255m`format_inline()\033[49m\033[39m."