withTags: Evaluate an expression using 'tags'

Description Usage Arguments Details Examples

Description

This function makes it simpler to write HTML-generating code. Instead of needing to specify tags each time a tag function is used, as in tags$div() and tags$p(), code inside withTags is evaluated with tags searched first, so you can simply use div() and p().

Usage

1

Arguments

code

A set of tags.

Details

If your code uses an object which happens to have the same name as an HTML tag function, such as source() or summary(), it will call the tag function. To call the intended (non-tags function), specify the namespace, as in base::source() or base::summary().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Using tags$ each time
tags$div(class = "myclass",
  tags$h3("header"),
  tags$p("text")
)

# Equivalent to above, but using withTags
withTags(
  div(class = "myclass",
    h3("header"),
    p("text")
  )
)

ymd526442121/Rproject_shiny documentation built on May 4, 2019, 5:31 p.m.