This {rui} R package provides a wrapper around different {cli} and {usethis} functions, aiming at providing a small but consistent set of verbs to construct a simple R package UI.
The idea is that all of the verbs allow the use of {glue} strings and {cli} styles, to streamline coding with {rui}.
As of version v0.2.0, the rui::console()
function provides an alternative API to the verbs, which may be easier for frequent {rui} users, although the verbs better communicate developer intent.
You can install the latest version of {rui} with the following:
if (!require(pak)) install.packages("pak")
pak::pak("rogiersbart/rui")
The {rui} verb API is used as follows:
rui::tell("Standard text")
#> Standard text
rui::entitle("Title a section")
#> # Title a section
rui::inform("Provide information")
#> i Provide information
rui::approve("Something seems to be fine")
#> v Something seems to be fine
rui::disapprove("Something seems to be wrong")
#> x Something seems to be wrong
The rui::console()
API allows the same to be achieved like this:
rui::console("Standard text")
#> Standard text
rui::console("# Title a section")
#> # Title a section
rui::console("i Provide information")
#> i Provide information
rui::console("v Something seems to be fine")
#> v Something seems to be fine
rui::console("x Something seems to be wrong")
#> x Something seems to be wrong
In a console/terminal, colours of the prefixes further help to distinguish the different kinds of messages. The above is just a subset of the functionality, however, as we have 19 verbs implemented at the moment. For a more thorough introduction, see vignette("rui")
.
The package logo is a derivative of Bart Rogiers’ CC BY 4.0-licensed espresso project.