flair_lines: Adds decorative formatting (flair) to parts of a string or...

View source: R/flair_lines.R

flair_linesR Documentation

Adds decorative formatting (flair) to parts of a string or source code, specified by line(s).

Description

flair_lines returns a string with formatting wrappers(currently only html), or applies the formatting to the source elements of a decorated object.

Usage

flair_lines(x, lines)

## Default S3 method:
flair_lines(x, lines)

Arguments

x

A string or decorated object

lines

Integer vector indicating which lines to apply the flair styling to.

Value

A string with formatting wrappers.

Examples


code_string <- "x <- mean(1:10, na.rm = TRUE)
sqrt(x)" %>% flair_lines(2)


r-for-educators/flair documentation built on Jan. 31, 2023, 11:18 a.m.