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
|
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" });
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user