From f902be2b8b6fe1e5330447b5255877ac471beeed Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Sun, 29 Oct 2023 15:56:45 +0800 Subject: [PATCH] docs: update example for load data from remote --- docs/cookery/guide/all-in-one.typ | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/cookery/guide/all-in-one.typ b/docs/cookery/guide/all-in-one.typ index 37068493..02fb3c26 100644 --- a/docs/cookery/guide/all-in-one.typ +++ b/docs/cookery/guide/all-in-one.typ @@ -118,6 +118,11 @@ The compilation result could be stored in an artifact in #link("https://github.c ```ts const vectorData = await $typst.vector({ mainContent }); +// or load vector data from remote +const remoteData = await (fetch( + './main.sir.in').then(resp => resp.arrayBuffer())); +const vectorData = new Uint8Array(remoteData); + // into svg format await $typst.svg({ vectorData }); // into canvas operations