R6 method for ExTera: add templates to library from file
paths.
$add_file_templates(...)Examples
tera <- new_engine()
writeLines(
'<p>Hello {{ x }}. This is {{ y }}.</p>',
con = file.path(tempdir(), "hello-world.html")
)
writeLines(
'<img src="{{ img_src }}">',
con = file.path(tempdir(), "img-src.html")
)
tera$add_file_templates(
"hello-world" = file.path(tempdir(), "hello-world.html"),
"img-src" = file.path(tempdir(), "img-src.html")
)
tera
#> ── ExTera ──
#> Template library:
#> • hello-world
#> • img-src