Skip to content

Commit

Permalink
docs: update example for load data from remote
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Oct 29, 2023
1 parent c2f7e95 commit f902be2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/cookery/guide/all-in-one.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f902be2

Please sign in to comment.