whisker.render {whisker} | R Documentation |
Logicless templating
Description
Logicless templating
Usage
whisker.render(template, data = parent.frame(), partials = list(),
debug = FALSE, strict = TRUE)
Arguments
template |
|
data |
named |
partials |
named |
debug |
Used for debugging purposes, likely to disappear |
strict |
|
Value
character
with rendered template
Note
By default whisker applies html escaping on the generated text. To prevent this use {{{variable}}} (triple) in stead of {{variable}}.
Examples
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&">
[Package whisker version 0.4.1 Index]