parse | R Documentation |
Sometimes you want to render multiple copies of a template, using different
sets of data variables. parse_template()
returns an intermediate version
of the template, so you can render()
repeatedly without re-parsing the
template syntax.
parse_template(.x, .config)
## S3 method for class 'character'
parse_template(.x, .config = default_config())
## S3 method for class 'fs_path'
parse_template(.x, .config = default_config())
.x |
The template. Choices:
|
.config |
The engine configuration. The default matches Jinja defaults,
but you can use |
A "jinjar_template"
object.
render()
to render the final document using data variables.
print()
for pretty printing.
vignette("template-syntax")
describes how to write templates.
x <- parse_template("Hello {{ name }}!")
render(x, name = "world")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.