cli does have a very rich string interpolation mechanism - https://cli.r-lib.org/reference/inline-markup.html
What is also nice about it is that it is a zero-dependent package so it does not increase this package a lot.
Currently, using the default glue_formatter I have:
r$> x <- NULL
r$> logger::log_info("x is {x}")
INFO [2024-09-05 11:05:01]
It would be great to have something like this:
r$> cli::cli_inform("{.var x} is {.var {x}}")
`x` is
For NULL value in particular - it is possible to modify glue appender by .null argument but here I do want to make use of other features of cli
Sounds like a feature request for a new formatter fn, using cli. I am not very familiar with the usage, so would appreciate a PR to make this happen -- otherwise I'll try to pick this up later.
cli
does have a very rich string interpolation mechanism - https://cli.r-lib.org/reference/inline-markup.html What is also nice about it is that it is a zero-dependent package so it does not increase this package a lot.Currently, using the default
glue_formatter
I have:It would be great to have something like this:
For
NULL
value in particular - it is possible to modify glue appender by.null
argument but here I do want to make use of other features of cli