This function can be used directly, or via the {.val ...}
inline
style. {.val {expr}}
calls cli_format()
automatically on the value
of expr
, before styling and collapsing it.
cli_format(x, style = list(), ...) # S3 method for default cli_format(x, style = list(), ...) # S3 method for character cli_format(x, style = list(), ...) # S3 method for numeric cli_format(x, style = list(), ...)
x | The object to format. |
---|---|
style | List of formatting options, see the individual methods for the style options they support. |
... | Additional arguments for methods. |
It is possible to define new S3 methods for cli_format
and then
these will be used automatically for {.cal ...}
expressions.
cli_vec
#> [1] "'this'" "'this'" "'this'" "'that'"#>#> [1] 0.14 0.29 0.43 0.57 0.71#> 0.142857142857143, 0.285714285714286, 0.428571428571429, 0.571428571428571, and #> 0.714285714285714#> 0.142857142857143, 0.285714285714286, 0.428571428571429, 0.571428571428571, and #> 0.714285714285714