diff --git a/main.c b/main.c index 6067955..ca0a1ad 100644 --- a/main.c +++ b/main.c @@ -35,7 +35,8 @@ Markdown mdt = { .code = 0 }; -FILE *fptr, *fpto; +FILE *fptr, *fpto, + *fcss, *fcss_target; char txt[MAX_LENGTH], of[MAX_LENGTH]; @@ -68,6 +69,32 @@ void add_css(void) { } } +void copy_css(void) { + const char *css = "./media/style.css"; + const char *css_target = "./target/style.css"; + int x; + + FILE *fcss = fopen(css, "r"); + if (fcss == NULL) { + perror("Tidak bisa membuka file masukan CSS"); + return; + } + + FILE *fcss_target = fopen(css_target, "w"); + if (fcss_target == NULL) { + perror("Tidak bisa membuka file keluaran CSS"); + fclose(fcss); + return; + } + + while ((x = fgetc(fcss)) != EOF) { + fputc(x, fcss_target); + } + + fclose(fcss); + fclose(fcss_target); +} + void newsetup(void) { struct stat st; if (stat("./source", &st) == -1) mkdir("./source", 0700); @@ -247,11 +274,15 @@ dohyperlink(void) { fprintf(fpto, "["); } +} +void build(void) { } void generate(void) { - fprintf(fpto, "\n
\n\n\n