Description Usage Arguments Value Examples
Wrap text with select HTML tags. tag
is generic in comparison to
specific tag types such as p
. Functions also contain an underscore
version (e.g., span_
). This version uses a built in
paste
to paste all elements together. For example the
following are equivalent:
h1(paste(LETTERS, ": ", em(letters)))
h1_(LETTERS, ": ", em(letters))
This is more natural to write with and more akin to how HTML tags work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
x |
A text string. |
left |
A left tag. |
right |
A right tag. |
extra |
Additional arguments to pass to a left tag such as styling. |
... |
Multiple text strings. |
Returns a vector of strings wrpped in HTML tags.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run: #'
tag(LETTERS, "<iframe>")
p(LETTERS)
h1_(LETTERS, ": ", em(letters))
p(paste(b(LETTERS), 1:26, letters))
span(LETTERS)
set.seed(10)
(body <-p(span(LETTERS, extra=sprintf("style=\"color:%s\"", sample(colors(), 26)))))
template2html(insert_body(highlight_template(c(x="")), body))
open_html()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.