You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inline markup features in {cli} are wonderful, and it would be very sad to limit their reach to only printing.
For instance, I would love to be able to use formats, pluralization, and collapsing in free text vectors (to use in the package {officer} in my case).
For now, I'm using a custom function but it might not be very stable and powerful, and I'm sure an official version would be a much-appreciated feature:
library(cli)
cli_glue=function(x) cli_fmt(cli_text(x), collapse=TRUE, strip_newline=TRUE) |>stringr::str_replace_all("\n", "")
x= cli_glue("All letters in lower case: {letters}")
x#> [1] "All letters in lower case: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, ..., y, and z"
You might say that this is out of the scope of {cli} which is all about printing. It would be in the scope of {glue}, but all those features lie in {cli}. It would be quite surprising that this is in the scope of no package IMHO.
The text was updated successfully, but these errors were encountered:
cli::format_inline("All letters in lower case: {letters}")
#> [1] "All letters in lower case: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, …, y, and z"
Hi,
The inline markup features in {cli} are wonderful, and it would be very sad to limit their reach to only printing.
For instance, I would love to be able to use formats, pluralization, and collapsing in free text vectors (to use in the package {officer} in my case).
For now, I'm using a custom function but it might not be very stable and powerful, and I'm sure an official version would be a much-appreciated feature:
Created on 2023-05-22 with reprex v2.0.2
You might say that this is out of the scope of {cli} which is all about printing. It would be in the scope of {glue}, but all those features lie in {cli}. It would be quite surprising that this is in the scope of no package IMHO.
The text was updated successfully, but these errors were encountered: