Description Usage Arguments Value Examples
Add a class to the root node of an HTML string
1 | add_class(html, class_name)
|
html |
Character. An HTML string. |
class_name |
Character. Class name to be added to the root node. |
Character. An HTML string with the class name added to the root node.
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(magrittr)
html <- "<!-- function handles comments--><div><p>R is fun</div></p>"
html %>% add_class("second-class")
html %>% add_class(".ok-to-start-with-period")
html %>% add_class("you-can") %>% add_class("chain-function-calls-too")
html %>% add_class("or add five at once")
html <- "<div class='using-single-quotes'><p>R is fun</div></p>"
html %>% add_class("is-ok-too")
html <- "<div class = 'lots-of-spaces'><p>R is fun</div></p>"
html %>% add_class("is-also-ok")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.