Render a template
Arguments
- path
Path to the store.
- name
Template name, as passed to
lq_add().- vars
Named character vector of template variables, e.g.
c(name = "Ada").- raw
If
TRUE, return the unrendered body instead of substitutingvars.- rev
Read the template as it existed at this revision instead of the working tree — a tag name (see
lq_tag()), or any revspec lengua understands (e.g."HEAD~1", a commit sha).- source
Read from this source specifically, bypassing merge precedence across sources — the only way to reach a copy shadowed by another source. Defaults to the merged view across every source.
Examples
store <- withr::local_tempdir()
lq_init(store)
lq_add(store, "hello.md", "Hi {{ name }}!")
lq_get(store, "hello.md", vars = c(name = "Ada"))
#> [1] "Hi Ada!"