File: builder.Rd

package info (click to toggle)
r-cran-shiny 1.0.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,080 kB
  • ctags: 290
  • sloc: makefile: 22; sh: 13
file content (96 lines) | stat: -rw-r--r-- 1,597 bytes parent folder | download | duplicates (3)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
\name{builder}
\alias{a}
\alias{br}
\alias{builder}
\alias{code}
\alias{div}
\alias{em}
\alias{h1}
\alias{h2}
\alias{h3}
\alias{h4}
\alias{h5}
\alias{h6}
\alias{hr}
\alias{img}
\alias{p}
\alias{pre}
\alias{span}
\alias{strong}
\alias{tags}
\title{HTML Builder Functions}
\usage{
tags

p(...)

h1(...)

h2(...)

h3(...)

h4(...)

h5(...)

h6(...)

a(...)

br(...)

div(...)

span(...)

pre(...)

code(...)

img(...)

strong(...)

em(...)

hr(...)
}
\arguments{
\item{...}{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), and raw
HTML (see \code{\link{HTML}}). You can also pass lists that contain tags,
text nodes, and HTML.}
}
\description{
Simple functions for constructing HTML documents.
}
\details{
The \code{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 \code{\link{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
\code{\link[base]{as.character}()}.
}
\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))
}