Description Usage Arguments Value Examples
Generate an HTML syntax with css for highlight marker tags that takes a body insert and can then be used to generate an HTML output with text highlighting.
1 | highlight_template(marker_color)
|
marker_color |
A named list or vector of colors. The colors will be used for highlighting and the names will correspond to the class name of the marker tag. |
Returns a vector with an HTML read template.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.