Debian Codegraph @

man/loader.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/loader.R
3 \name{loader}
4 \alias{loader}
5 \alias{path_loader}
6 \alias{package_loader}
7 \alias{list_loader}
8 \title{Template loaders}
9 \usage{
10 path_loader(...)
11
12 package_loader(package, ...)
13
14 list_loader(x)
15 }
16 \arguments{
17 \item{...}{Strings specifying path components.}
18
19 \item{package}{Name of the package in which to search.}
20
21 \item{x}{Named list mapping template names to template sources.}
22 }
23 \value{
24 A \code{"jinjar_loader"} object.
25 }
26 \description{
27 Loaders are responsible for exposing templates to the templating engine.
28
29 \code{path_loader()} loads templates from a directory in the file system.
30
31 \code{package_loader()} loads templates from a directory in an R package.
32
33 \code{list_loader()} loads templates from a named list.
34 }
35 \examples{
36 path_loader(getwd())
37
38 package_loader("base", "demo")
39
40 list_loader(list(
41 header = "Title: {{ title }}",
42 content = "Hello {{ person }}!"
43 ))
44 }
45 \seealso{
46 The loader is an argument to \code{\link[=jinjar_config]{jinjar_config()}}.
47 }