Blame


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