diff options
author | sanine <sanine.not@pm.me> | 2022-01-02 01:25:07 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-01-02 01:25:07 -0600 |
commit | a0c01b8ab019039094f036a287db6cfdbe9cdca6 (patch) | |
tree | dddd4e3968011c8857df7de849d80aed18f32cb4 /src/argent.c | |
parent | e7c41c6d0af6f718f431fbc8ec9b488d37d118d9 (diff) |
implement markdown() function
Diffstat (limited to 'src/argent.c')
-rw-r--r-- | src/argent.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/argent.c b/src/argent.c index c42161a..7426394 100644 --- a/src/argent.c +++ b/src/argent.c @@ -3,10 +3,14 @@ #include <lauxlib.h> #include "honeysuckle.h" -#include "md4c-html.h" -#include "tinydir.h" #include "options.h" +#include "bindings.h" + + +struct settings { + const char *template_dir; +}; int main(int argc, char **argv) @@ -25,11 +29,27 @@ int main(int argc, char **argv) lua_State *L = luaL_newstate(); luaL_openlibs(L); - error = luaL_dofile(L, opts.conf_filename); + hs_create_table + (L, + hs_str_cfunc("markdown", markdown) + ); + lua_setglobal(L, "argent"); + + error = luaL_loadfile(L, opts.conf_filename); + if (error != 0) { + fprintf(stderr, "error: %s\n", lua_tostring(L, -1)); + lua_close(L); + return error; + } + error = hs_call(L, 0, 1); if (error != 0) { fprintf(stderr, "error: %s\n", lua_tostring(L, -1)); + lua_close(L); + return error; } - + + printf("here!\n"); + lua_close(L); return 0; } |