formatter: formatter

formatterR Documentation

formatter

Description

R6 class for formatting strings for console or markup output

Value

a formatter class (R6 class)

Methods

Public methods


Method new()

Usage
formatter$new(level = "INFO")
Arguments
level

The text message type to initialize messaging to

Returns

none Nothing is returned

format a string for console or markup output


Method wrap_text()

Usage
formatter$wrap_text(txt, style, appendTo = "")
Arguments
txt

string to wrap in a style

style

string name of a styles key

appendTo

sting to appended the styled text to

Returns
Examples
txt = formatter::wrap_text("My Title","h1","")


Method clone()

The objects of this class are cloneable with this method.

Usage
formatter$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


f = formatter$new()
formatted_text = f$wrap_text("text","h1","example ")

Initialize object


## ------------------------------------------------
## Method `formatter$wrap_text`
## ------------------------------------------------


txt = formatter::wrap_text("My Title","h1","")


namc-utah/NAMCr documentation built on Feb. 12, 2024, 4:29 a.m.