builder

0th

Percentile

HTML Builder Functions

Simple functions for constructing HTML documents.

Usage
tags

p(...)

h1(...)

h2(...)

h3(...)

h4(...)

h5(...)

h6(...)

a(...)

br(...)

div(...)

span(...)

pre(...)

code(...)

img(...)

strong(...)

em(...)

hr(...)

Arguments
...
Attributes and children of the element. Named arguments become attributes, and positional arguments become children. Valid children are tags, single-character character vectors (which become text nodes), raw HTML (see HTML), and html_dependency objects. You can also pass lists that contain tags, text nodes, or HTML.
Details

The tags environment contains convenience functions for all valid HTML5 tags. To generate tags that are not part of the HTML5 specification, you can use the tag() function. Dedicated functions are available for the most common HTML tags that do not conflict with common R functions. The result from these functions is a tag object, which can be converted using as.character().

Aliases
  • builder
  • tags
  • p
  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
  • a
  • br
  • div
  • span
  • pre
  • code
  • img
  • strong
  • em
  • hr
Examples
doc <- tags$html(
  tags$head(
    tags$title('My first page')
  ),
  tags$body(
    h1('My first heading'),
    p('My first paragraph, with some ',
      strong('bold'),
      ' text.'),
    div(id='myDiv', class='simpleDiv',
        'Here is a div with some attributes.')
  )
)
cat(as.character(doc))
Documentation reproduced from package htmltools, version 0.3.6, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.