r-lib / cli

Tools for making beautiful & useful command line interfaces
https://cli.r-lib.org/
Other
625 stars 66 forks source link

More control over indentation for `cli_bullets()` #673

Closed wurli closed 2 weeks ago

wurli commented 4 months ago

cli_bullets() lets you use " " for an indented item, without a symbol:

cli::cli_bullets(c(
  " " = "indent",
  "*" = "bullet"
))
#>   indent
#> • bullet

It would be nice to be able to indent by more than 2 spaces, or to indent bullets whilst retaining the symbol. Perhaps a nice API would be to control this by prepending spaces to the existing bullet names:

cli::cli_bullets(c(
  " "   = "indent",
  "*"   = "bullet",
  " *"  = "indented bullet",
  "  "  = "double indent",
  "  *" = "double indented bullet
))
#>   indent
#> • bullet
#>   • indented bullet
#>     double indent
#>     • double indented bullet
gaborcsardi commented 2 weeks ago

I think you can customize this with themes, see the examples of the default here: https://github.com/r-lib/cli/blob/5f033eb5ae49fe576d1863b86cb1442c77c70087/R/themes.R#L133

gaborcsardi commented 2 weeks ago

Please comment if you have more questions.