2 014c66b6 2023-06-25 op #include <sys/queue.h>
3 014c66b6 2023-06-25 op #include <string.h>
4 014c66b6 2023-06-25 op #include "lists.h"
5 014c66b6 2023-06-25 op #include "tmpl.h"
7 014c66b6 2023-06-25 op int list(struct template *, struct tailhead *);
11 014c66b6 2023-06-25 op {{ define base(struct template *tp, struct tailhead *head) }}
12 014c66b6 2023-06-25 op <!doctype html>
15 014c66b6 2023-06-25 op {{ render list(tp, head) }}
20 014c66b6 2023-06-25 op {{ define list(struct template *tp, struct tailhead *head) }}
22 014c66b6 2023-06-25 op struct entry *np;
25 014c66b6 2023-06-25 op {{ if !TAILQ_EMPTY(head) }}
28 014c66b6 2023-06-25 op {{ tailq-foreach np head entries }}
29 014c66b6 2023-06-25 op <li>{{ np->text }}</li>
33 014c66b6 2023-06-25 op <p>no items</p>
37 014c66b6 2023-06-25 op {{ for i = 0; i < 3; ++i }}
38 014c66b6 2023-06-25 op hello{{ " " }}