From 7295dfb8826d1ee7de9295faab8af0614f84f2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Proch=C3=A1zka?= Date: Mon, 6 Oct 2025 19:41:49 +0200 Subject: [PATCH] Template generation is now split up into its own function --- data.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/data.js b/data.js index 7f26c91..da8042b 100644 --- a/data.js +++ b/data.js @@ -132,10 +132,7 @@ const typst_header = `#import "template/template.typ": * skibidi `; -async function generate_zip() { - let assets_zip = await fetch("template.zip"); - let out_zip = await new JSZip().loadAsync(await assets_zip.blob()); - +function generate_template() { let out = typst_header; for(const step_key in steps) { @@ -180,7 +177,14 @@ async function generate_zip() { console.log(out); - out_zip.file("thesis.typ", out); + return out; +} + +async function generate_zip() { + let assets_zip = await fetch("template.zip"); + let out_zip = await new JSZip().loadAsync(await assets_zip.blob()); + + out_zip.file("thesis.typ", generate_template()); return await out_zip.generateAsync({ type: "blob" }); }