Skip to contents

Marks text with a role, which the theme styles: r8span() makes one line of one span, which r8text() joins with other text and c() stacks. Text output names roles, never colors, so the theme restyles every encoding: ANSI, HTML, and markdown, which keeps strong and emphasis.

Usage

r8span(text, role)

Arguments

text

Character: One string, without line breaks.

role

Character: The role.

Value

An r8_text object: a character vector of plain lines, with the spans of its roles and the depth of each line as attributes.

Details

The roles are bracket, type_name, variant, field_name, scalar, summary, user_text, strong, emphasis, muted, highlight, and plain, and the roles of base-type names after rtemislive's column types: type_number (double), type_integer, type_categorical (factor), type_string (character), type_boolean (logical), type_datetime (Date and POSIXct), and type_other.

Author

EDG

Examples

r8text("GBM ", r8span("trained", "highlight"), " in 12 s")
#> GBM trained in 12 s