-
Notifications
You must be signed in to change notification settings - Fork 5
/
README
34 lines (25 loc) · 835 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
libio is a C library that provides a Lua templating system.
This means it can parse template files with embedded Lua code.
For example, say you have a file hello.tpl:
Hello, {{ string.lower(name) }}
In order to parse this file and produce the wanted output, you have to write
this little C program:
#include <libio/io_template.h>
#include <embody/embody.h>
#include <sds.h>
int main() {
io_template_t *T = io_template_new(NULL);
io_template_set_template_file("hello.tpl");
io_template_param(T, "name", emb_new("sds", sdsnew("WORLD")));
puts(io_template_render(T));
io_template_free(T);
return 0;
}
That will produce the following output:
Hello, world
Requirements
============
libio requires the following libraries:
* libgends (>= 2)
* sds
* embody