Blame


1 84efe063 2023-04-04 thomas {!
2 84efe063 2023-04-04 thomas #include <stdlib.h>
3 84efe063 2023-04-04 thomas
4 84efe063 2023-04-04 thomas #include "tmpl.h"
5 84efe063 2023-04-04 thomas
6 84efe063 2023-04-04 thomas int base(struct template *, const char *);
7 84efe063 2023-04-04 thomas
8 84efe063 2023-04-04 thomas !}
9 84efe063 2023-04-04 thomas
10 84efe063 2023-04-04 thomas {{ define base(struct template *tp, const char *title) }}
11 84efe063 2023-04-04 thomas {! char *foo = NULL; !}
12 84efe063 2023-04-04 thomas <!doctype html>
13 84efe063 2023-04-04 thomas <html>
14 84efe063 2023-04-04 thomas <head>
15 84efe063 2023-04-04 thomas <title>{{ title }}</title>
16 84efe063 2023-04-04 thomas </head>
17 84efe063 2023-04-04 thomas <body> {! /* TODO: frobnicate this line! */ !}
18 84efe063 2023-04-04 thomas <h1>{{ title }}</h1>
19 84efe063 2023-04-04 thomas {{ " | " }}
20 84efe063 2023-04-04 thomas {{ "other stuff" }}
21 84efe063 2023-04-04 thomas <script>
22 84efe063 2023-04-04 thomas function greet() {
23 84efe063 2023-04-04 thomas console.log("hello, world");
24 84efe063 2023-04-04 thomas }
25 84efe063 2023-04-04 thomas (function() {
26 84efe063 2023-04-04 thomas greet();
27 84efe063 2023-04-04 thomas })();
28 84efe063 2023-04-04 thomas </script>
29 84efe063 2023-04-04 thomas </body>
30 84efe063 2023-04-04 thomas </html>
31 84efe063 2023-04-04 thomas {{ finally }}
32 84efe063 2023-04-04 thomas {! free(foo); !}
33 84efe063 2023-04-04 thomas {{ end }}