R6 method for ExTera: render specified template to file.
$render(template, outfile, ...)Examples
tera <- new_engine()
tera$add_string_templates(
"hello-world" = '<p>Hello {{ x }}. This is {{ y }}.</p>'
)
outfile <- file.path(tempdir(), "rendered-hello-world.html")
tera$render(
"hello-world",
outfile = outfile,
x = "world",
y = "ExTera"
)
readLines(outfile, warn = FALSE)
#> [1] "<p>Hello world. This is ExTera.</p>"