tmpl_glue | R Documentation |
Use this template engine to create pages with glue templates.
See glue::glue()
for the syntax.
tmpl_glue( sep = "", open = "{", close = "}", na = "NA", transformer = NULL, trim = TRUE )
sep |
Separator used to separate elements. |
open |
The opening delimiter. Doubling the full delimiter escapes it. |
close |
The closing delimiter. Doubling the full delimiter escapes it. |
na |
Value to replace NA values with. If |
transformer |
A function taking three parameters |
trim |
Whether to trim the input template with |
Template function.
# See th 'hello' app at hello_root <- system.file(package = "webfakes", "examples", "hello") hello_root app <- new_app() app$engine("txt", tmpl_glue()) app$use(mw_log()) app$get("/view", function(req, res) { txt <- res$render("test") res$ set_type("text/plain")$ send(txt) }) # Switch to the app's root: setwd(hello_root) # Now start the app with: app$listen(3000L) # Or start it in another process: new_process(app)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.