render <-
function # simple string-interpolation
(
tmpl # template-string
,repl # replacement assoc-list
,varChar = "$" # variable-symbol
)
{
Reduce(
function(s, n)
{
gsub(paste("\\", varChar, n, "\\", varChar, sep = ""),
repl[[n]], s)
}
,names(repl)
,tmpl
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.