insert_body: Insert the Body Into a Template

Description Usage Arguments Value Examples

Description

Insert the body into a template that has been created using highlight_template.

Usage

1
insert_body(template, body)

Arguments

template

A template that has been created using highlight_template.

body

The text body (a character vector).

Value

Returns a template with a body inserted (character vector).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
marks <- c(pos = "lightgreen", neg = "pink", neutral = "yellow")

temp <- highlight_template(marks)
body <- paste0("I like <mark class=\"pos\">good</mark>",
    " <mark class=\"neutral\">fish</mark>",
    ", but <mark class=\"neg\">bad</mark> <mark class=\"neutral\">fish</mark>",
    " is <mark class=\"neg\">gross</mark>.")

template2html(insert_body(highlight_template(marks), body), file="")
## Not run: 
## To an external file
template2html(insert_body(highlight_template(marks), body))
open_html()

## End(Not run)

trinker/hilight documentation built on May 31, 2019, 8:51 p.m.