Note that this is in addition to the builtin theme. To use this theme,
you can set it as the cli.theme
option:
simple_theme(dark = getOption("cli_theme_dark", "auto"))
dark | Whether the theme should be optiomized for a dark
background. If |
---|
options(cli.theme = cli::simple_theme())
and then CLI apps started after this will use it as the default theme. You can also use it temporarily, in a div element:
cli_div(theme = cli::simple_theme())
#>#>#>#> Heading 2 ──#>#>#> ✖ Danger alert#> ! Warning alert#> ℹ Info alert#> ✔ Success alert#>#> cli 1.0.0.#>#> Emphasis and strong emphasis#> `sum(x) / length(x)`#> `cli::simple_theme()`#> /usr/bin/env#> <https://r-project.org>#>#> Longer code chunk ──#>cli_par(class = "code R") cli_verbatim( '# window functions are useful for grouped mutates', 'mtcars %>%', ' group_by(cyl) %>%', ' mutate(rank = min_rank(desc(mpg)))')#> # window functions are useful for grouped mutates #> %>% #> group_by(cyl) %>% #> mutate(rank = min_rank(desc(mpg)))#>#> Even longer code chunk ──#>#> function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE, #> TRUE) #> { #> if (!missing(name)) { #> <- tryCatch(name, error = function(e) e) #> if (inherits(pos, "error")) { #> <- substitute(name) #> if (!is.character(name)) #> <- deparse(name) #> warning(gettextf("%s converted to character string", #> sQuote(name)), domain = NA) #> <- name #> } #> } #> <- .Internal(ls(envir, all.names, sorted)) #> if (!missing(pattern)) { #> if ((ll <- length(grep("[", pattern, fixed = TRUE))) && #> length(grep("]", pattern, fixed = TRUE))) { #> if (pattern == "[") { #> <- "\\[" #> warning("replaced regular expression pattern '[' by '\\\\['") #> } #> else if (length(grep("[^\\\\]\\[<-", pattern))) { #> <- sub("\\[<-", "\\\\\\[<-", pattern) #> warning("replaced '[<-' by '\\\\[<-' in regular expression pattern") #> } #> } #> grep(pattern, all.names, value = TRUE) #> } #> else all.names #> }#>