extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
196 stars 28 forks source link

Adding {cli} support to 'ui_*' #89

Closed Ilia-Kosenkov closed 3 years ago

Ilia-Kosenkov commented 3 years ago

Fixes #88. I originally failed to recognize that cli::cli_format_method() captures {cli} output into a simple character string that can be later reused.

This PR adds support for all of the {cli} features to ui_throw(), ui_x(), etc. E.g.:

ui_throw(
  "An error happened in {.fun package::function}",
  c(
    ui_x("File {.file my_file} does not exist."),
    ui_i("Index out of range at: {.var {1:5}}.")
  )
)

image