GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cli
  • FAQ
  • Reference
  • Building a Semantic CLI
  • From usethis::ui functions to cli
  • cli pluralization
  • Introduction to progress bars in cli
  • Advanced cli progress bars
  • cli color palettes
  • More articles...
  • Changelog

This view

  • Original page
  • New address

GeezerVison is showing cli.r-lib.org — Generic CLI container — cli_div

Generic CLI container

Source: R/cli.R
cli_div.Rd

See containers. A cli_div container is special, because it may add new themes, that are valid within the container.

Usage

cli_div(
  id = NULL,
  class = NULL,
  theme = NULL,
  .auto_close = TRUE,
  .envir = parent.frame()
)

Arguments

id

Element id, a string. If NULL, then a new id is generated and returned.

class

Class name, sting. Can be used in themes.

theme

A custom theme for the container. See themes.

.auto_close

Whether to close the container, when the calling function finishes (or .envir is removed, if specified).

.envir

Environment to evaluate the glue expressions in. It is also used to auto-close the container if .auto_close is TRUE.

Value

The id of the new container element, invisibly.

Details

Custom themes

d <- cli_div(theme = list(h1 = list(color = "cyan",
                                    "font-weight" = "bold")))
cli_h1("Custom title")
cli_end(d)

#>
#> Custom title

Auto-closing

By default a cli_div() is closed automatically when the calling frame exits.

div <- function() {
  cli_div(class = "tmp", theme = list(.tmp = list(color = "yellow")))
  cli_text("This is yellow")
}
div()
cli_text("This is not yellow any more")

#> This is yellow
#> This is not yellow any more
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.