Process an HTML template — htmlTemplate

v1.7.4|Source: R/template.R


Process an HTML template and return a tagList object. If the template is a complete HTML document, then the returned object will also have class html_document, and can be passed to the function renderDocument() to get the final HTML text.

htmlTemplate(filename = NULL, ..., text_ = NULL, document_ = "auto")



Path to an HTML template file. Incompatible with text_.


Variable values to use when processing the template.


A string to use as the template, instead of a file. Incompatible with filename.


Is this template a complete HTML document (TRUE), or a fragment of HTML that is to be inserted into an HTML document (FALSE)? With "auto" (the default), auto-detect by searching for the string "<HTML>" within the template.

See also