Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

renderDocument

Render an html_document object


Description

This function renders html_document objects, and returns a string with the final HTML content. It calls the renderTags function to convert any shiny.tag objects to HTML. It also finds any any web dependencies (created by htmlDependency) that are attached to the tags, and inserts those. To do the insertion, this function finds the string "<!-- HEAD_CONTENT -->" in the document, and replaces it with the web dependencies.

Usage

renderDocument(x, deps = NULL, processDep = identity)

Arguments

x

An object of class html_document, typically generated by the htmlTemplate function.

deps

Any extra web dependencies to add to the html document. This can be an object created by htmlDependency, or a list of such objects. These dependencies will be added first, before other dependencies.

processDep

A function that takes a "raw" html_dependency object and does further processing on it. For example, when renderDocument is called from Shiny, the function createWebDependency is used; it modifies the href and tells Shiny to serve a particular path on the filesystem.

Value

An HTML string, with UTF-8 encoding.


htmltools

Tools for HTML

v0.5.1.1
GPL (>= 2)
Authors
Joe Cheng [aut], Carson Sievert [aut, cre] (<https://orcid.org/0000-0002-4958-2844>), Winston Chang [aut], Yihui Xie [aut], Jeff Allen [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.