A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://rstudio.github.io/htmltools/reference/tagFunction.html below:

Tag function — tagFunction • htmltools

Create 'lazily' rendered HTML tags (and/or htmlDependencies()).

Arguments
func

a function with no arguments that returns HTML tags and/or dependencies.

Details

When possible, use tagAddRenderHook() to provide both a tag structure and utilize a render function.

Examples
myDivDep <- tagFunction(function() {
  if (isTRUE(getOption("useDep", TRUE))) {
    htmlDependency(
      name = "lazy-dependency",
      version = "1.0", src = ""
    )
  }
})
myDiv <- attachDependencies(div(), myDivDep)
renderTags(myDiv)
#> $head
#> 
#> 
#> $singletons
#> character(0)
#> 
#> $dependencies
#> $dependencies[[1]]
#> List of 10
#>  $ name      : chr "lazy-dependency"
#>  $ version   : chr "1.0"
#>  $ src       :List of 1
#>   ..$ file: chr ""
#>  $ meta      : NULL
#>  $ script    : NULL
#>  $ stylesheet: NULL
#>  $ head      : NULL
#>  $ attachment: NULL
#>  $ package   : NULL
#>  $ all_files : logi TRUE
#>  - attr(*, "class")= chr "html_dependency"
#> 
#> 
#> $html
#> <div></div>
#> 
withr::with_options(list(useDep = FALSE), renderTags(myDiv))
#> $head
#> 
#> 
#> $singletons
#> character(0)
#> 
#> $dependencies
#> list()
#> 
#> $html
#> <div></div>
#> 


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4