Template generation is now split up into its own function

This commit is contained in:
2025-10-06 19:41:49 +02:00
parent 6d1554fa43
commit 7295dfb882

14
data.js
View File

@@ -132,10 +132,7 @@ const typst_header = `#import "template/template.typ": *
skibidi skibidi
`; `;
async function generate_zip() { function generate_template() {
let assets_zip = await fetch("template.zip");
let out_zip = await new JSZip().loadAsync(await assets_zip.blob());
let out = typst_header; let out = typst_header;
for(const step_key in steps) { for(const step_key in steps) {
@@ -180,7 +177,14 @@ async function generate_zip() {
console.log(out); 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" }); return await out_zip.generateAsync({ type: "blob" });
} }