Highlight HTML Text

Usage

HL(text = "clipboard", color = "yellow", copy2clip = interactive(), print = FALSE)

Arguments

text
A character vector or text copied to the clipboard. Default is to read from the clipboard.
color
A character string taken from R's built-in color names or a hexidecimal color.
copy2clip
logical. If TRUE attempts to copy the output to the clipboard.
print
logical. If TRUE cat prints the output to the console. If FALSE returns to the console.

Description

Wraps text with a background color specific font tags.

Examples

cat(HL("Do not trust robots!"), "They are bent on destruction.")
Do not trust robots! They are bent on destruction.
cat(HL("Jake is a cookie scientist,", color="pink"), "an honrable profession.")
Jake is a cookie scientist, an honrable profession.