aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-07-11 12:35:34 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-07-11 12:35:34 +0530
commitf62c7ced4f529a069530e6effc370371338eb3af (patch)
treeaa6baaf130dcf02aaeb731855d9157c5cba1f43e /src/main.c
parentb666cf57efc0028a8648b068ffe6ba1630784444 (diff)
main: handle markdown files
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 7a88ec4..b14a9b7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -71,7 +71,7 @@ handle_file(const char *path)
if (dot && strcmp(dot, ".md") == 0) {
MMIOT *doc = mkd_string(buffer, size, 0);
- template_write(base_template, NULL, out, doc, false);
+ template_write(base_template, NULL, out, doc, true);
} else if (strlen(buffer) != 0) {
list_t *content_headers = ingest(&buffer);
template_write(base_template, content_headers, out, buffer, false);
@@ -118,15 +118,14 @@ main(int argc, char **argv)
printf("HANDLING: %s\n", filepath);
handle_file(filepath);
free(filepath);
-
- return EXIT_SUCCESS;
}
- /* for (x = (char **) md_resources; *x != NULL; x++) { */
- /* asprintf(&filepath, "%s.md", *x); */
- /* handle_file(filepath); */
- /* free(filepath); */
- /* } */
+ for (x = (char **) md_resources; *x != NULL; x++) {
+ asprintf(&filepath, "%s.md", *x);
+ printf("HANDLING: %s\n", filepath);
+ handle_file(filepath);
+ free(filepath);
+ }
return EXIT_SUCCESS;
}