site

A custom static site generator written in C.
git clone https://unitehenry.com/git/site.git
Log | Files | Refs | README

commit 8c801c65d2b6ab724438a5bacbbad2a4ccecd6ae
parent 840d6e61a644d755e87c972c917112faf051e150
Author: Henry Unite <unitehenry@gmail.com>
Date:   Thu,  9 Apr 2026 03:43:58 +0000

feat: run pandoc fp

Diffstat:
Msrc/main.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -46,7 +46,7 @@ void get_content_files(StringList *list, char *content_path) { closedir(dr); } -FILE *run_pandoc(char *content_path) { +void run_pandoc(FILE *fp, char *content_path) { char *PANDOC_CMD = "pandoc "; size_t command_len = strlen(content_path) + strlen(PANDOC_CMD) + 2; @@ -55,7 +55,7 @@ FILE *run_pandoc(char *content_path) { snprintf(command, sizeof(command), "%s %s", PANDOC_CMD, content_path); - return popen(command, "w"); + fp = popen(command, "w"); } void generate_pages(StringList *list) { @@ -80,7 +80,9 @@ void generate_pages(StringList *list) { continue; - FILE *fp = run_pandoc(list->strings[i]); + FILE *fp; + + run_pandoc(fp, list->strings[i]); char *line = NULL;