Logicless templating
whisker.render(template, data = parent.frame(), partials = list(),
debug = FALSE, strict = TRUE)
character
with template text
named list
or environment
with variables that will be used during rendering
named list
with partial templates, will be used during template construction
Used for debugging purposes, likely to disappear
logical
if TRUE
the seperation symbol is a "." otherwise a "$"
character
with rendered template
# NOT RUN { template <- "Hello {{place}}!" place <- "World" whisker.render(template) # to prevent html escaping use triple {{{}}} template <- "I'm escaped: {{name}} And I'm not: {{{name}}}" data <- list( name = '<My Name="Nescio&">') whisker.render(template, data) # I'm escaped: <My Name="Nescio&"> # And I'm not: <My Name="Nescio&"> # }