I am doing a presentation on typst and for external reasons am writing the slides in html.
Does anyone (maybe the people who made the websites and stuff in the first place) what framework best to use for syntax highlighting of <code>?
highlight.js seems not to have a typst specific language support yet.
(I poured about six hours into writing one myself before being frustrated now and… just asking for help…)
I don’t know the highlight framework used here (in this forum). The html of the code block in this forum contains a hljs, so I suspect it is highlight.js. I searched on the web and found a package that uses highlight.js to highlight typst:
But I recommend using the shiki package, which has builtin support for typst: Languages | Shiki
Both use the Typst compiler directly to highlight, either in the build process in CI or in WASM using a custom Discourse plugin leveraging the typst-syntax crate.