Use the pug templating engine with ambiorix.
# install.packages("remotes")
remotes::install_github("devOpifex/pugger")
Set the custom template with app$engine()
use
method.
Render the following test.pug
file.
!!! 5
html(lang="en")
head
title= pageTitle
:javascript
| if (foo) {
| bar()
| }
body
h1 Jade - node template engine
#container
- if (iUseJader)
Vape juice are amazing
- else
Get on it!
Get on it!
Get on it!
Get on it!
With the following app.
library(ambiorix)
app <- Ambiorix$new()
# on older versions of ambiorix
# app$use(jader::jader())
app$engine(jader::jader())
app$get("/", \(req, res) {
res$render(
"test.jade",
list(
iUseJader = TRUE
)
)
})
app$start()
Outside of Ambiorix
Just use renderer
.
pugger::renderer(
"test.pug",
list(de
iUsePugger = TRUE
)
)