aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hyde.c35
-rw-r--r--src/template.c2
2 files changed, 1 insertions, 36 deletions
diff --git a/src/hyde.c b/src/hyde.c
deleted file mode 100644
index 350a518..0000000
--- a/src/hyde.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "template.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-struct post {
- char title[64];
- char tags[8][32];
-};
-
-int main() {
- char *input = read_file("index.tpl");
-
- struct hashmap *ctx = hashmap_new();
- hashmap_insert(ctx, "title", "Hello world");
-
- struct post home = {
- .title = "Homepage",
- .tags = {
- "Tag 1", "Tag 2"
- }
- };
- hashmap_insert(ctx, "home", &home);
-
- struct post posts[] = {
- { .title = "Post 1", .tags = { "p1t1" } },
- { .title = "Post 2", .tags = { "p2t1" } },
- };
- hashmap_insert(ctx, "posts", &posts);
-
- char *output = template(input, ctx);
- printf("Output: %s\n", output);
- hashmap_free(ctx);
- free(input);
- free(output);
-} \ No newline at end of file
diff --git a/src/template.c b/src/template.c
index 15ce246..85db75a 100644
--- a/src/template.c
+++ b/src/template.c
@@ -70,7 +70,7 @@ int eval(char *dest, mpc_ast_t* t, struct hashmap *ctx) {
dest = trim_trailing_whitespace(dest);
}
- // set flag for next eval() to trim leading whitespace from text
+ /* set flag for next eval() to trim leading whitespace from text */
if (strstr(t->children[3]->contents, "-")) {
trim_whitespace = 1;
}