loader {jinjar}R Documentation

Template loaders

Description

Loaders are responsible for exposing templates to the templating engine.

path_loader() loads templates from a directory in the file system.

package_loader() loads templates from a directory in an R package.

list_loader() loads templates from a named list.

Usage

path_loader(...)

package_loader(package, ...)

list_loader(x)

Arguments

...

Strings specifying path components.

package

Name of the package in which to search.

x

Named list mapping template names to template sources.

Value

A "jinjar_loader" object.

See Also

The loader is an argument to jinjar_config().

Examples

path_loader(getwd())

package_loader("base", "demo")

list_loader(list(
  header = "Title: {{ title }}",
  content = "Hello {{ person }}!"
))

[Package jinjar version 0.3.1 Index]