Is the Typst web preview available as a standalone JS library? I’m loving Typst and would like to make some interactive tutorials on it. I basically want to re-create the Typst Playground but manage CodeMirror myself, so I just need the preview code. I found https://www.npmjs.com/package/typst but that doesn’t work in the browser + hasn’t been updated in 3 years.
According to Typst: Open Source, the web app is closed-source.
Alternatively, you can use the community project typst.ts.
If that tutorial is about typst itself, then there have already been some similar projects. Check
Documentation | Best of Typst (TCDM). To name a few:
-
Typlica — Typst 练习平台
An interactive Typst exercise platform — bringing a Rustlings-style learning experience to the Typst world. -
typst-fumadocs
Interactive Typst documentation powered by Fumadocs with live code editing and real-time rendering. -
GitHub - Myriad-Dreamin/interactive-typst-tutorial: Interactive Typst tutorial · GitHub
This project was created by the main contributor of typst.ts two weeks ago.
However, none of them is mature at present.