Blob


1 {!
2 #include <sys/queue.h>
3 #include <string.h>
4 #include "lists.h"
6 int list(struct template *, struct tailhead *);
8 !}
10 {{ define base(struct template *tp, struct tailhead *head) }}
11 <!doctype html>
12 <html>
13 <body>
14 {{ render list(tp, head) }}
15 </body>
16 </html>
17 {{ end }}
19 {{ define list(struct template *tp, struct tailhead *head) }}
20 {! struct entry *np; !}
21 {{ if !TAILQ_EMPTY(head) }}
22 <p>items:</p>
23 <ul>
24 {{ tailq-foreach np head entries }}
25 <li>{{ np->text }}</li>
26 {{ end }}
27 </ul>
28 {{ else }}
29 <p>no items</p>
30 {{ end }}
31 {{ end }}