Template generation is now split up into its own function
This commit is contained in:
14
data.js
14
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" });
|
||||
}
|
||||
|
Reference in New Issue
Block a user