Background
I want to use the latest version of typst (0.13.1) for Obsidian-typst.
e.g. Instead of $A sect B$
, use $A inter B$
for " A ∩ B ".
Attempt
I forked its repo and made some changes, so that I can use the latest version of some packages, like fletcher.
However my fork has failed to download some plugins, like CeTZ 0.4.0 onwards
It only managed to render CeTZ images up to 0.3.4
Obsidian’s console complained
b66e5cb4-97d8-4368-83e5-7c08fef193f6:1 Uncaught Error: failed to load WebAssembly module (unexpected end-of-file (at offset 0xd))
╭─[ @preview/cetz:0.4.0/src/matrix.typ:3:25 ]
│
3 │ #let cetz-core = plugin(“…/cetz-core/cetz_core.wasm”)
───╯
after the method compile_image()
had been called.
Is there a way to read a typst package’s WASM?
I have too little insight into obsidian-typst to say more, but I’d investigate the following things:
- are you sure you’re using your plugin? I found this line, if it is run it would mean you’re using a release version of the original code. To check, you could add a panic somewhere.
- 0.4.0 is the first version of CeTZ to use WASM. Does the same happen with other packages using WASM, e.g. using suiji’s “fast” functions? (I’m pretty sure it will, but good to check)
- reading files seems to go through this JS function, so you should be able to print/debug the file contents you get. Check what is reported as
cetz_core.wasm
’s contents, and compare to the one here.
Detailed JS & Rust debugging help for tools that integrate Typst is out of this forum’s scope, but I hope this has helped a bit.
thank you for your time and effort to look into this, but after testing another plugin, i don’t think i’ll continue spending time on that cuz i reli wanna get back to the study material