Debian Codegraph @

tests/testthat/knit-engine.Rmd

raw
1 ---
2 title: "knit engine"
3 output: html_document
4 ---
5
6 ```{r setup}
7 library(jinjar)
8 ```
9
10 ```{r}
11 contents <- list(
12 navigation = data.frame(
13 caption = c("Home", "Blog"),
14 href = c("index.html", "blog.html")
15 ),
16 title = "My Webpage"
17 )
18 ```
19
20 ```{jinjar, jinjar_lang="html", data=contents}
21 <!DOCTYPE html>
22 <html lang="en">
23 <head>
24 <title>{{ title }}</title>
25 </head>
26 <body>
27 <ul id="navigation">
28 {% for item in navigation -%}
29 <li><a href="{{ item.href }}">{{ item.caption }}</a></li>
30 {% endfor -%}
31 </ul>
32 </body>
33 </html>
34 ```