In the LaTeX world, we have MathJax and KaTeX to beautifully typeset math on the web. I would love to see equivalent projects for the Typst world since I love the simplicity of the Typst math syntax.
well, you can already already sort of do this through HTML export and frames, which will inline an SVG:
#html.frame($ 2 + 2 = 4 - 1 = 3$)
quick mafs
though the text doesn’t seem to be selectable (which is probably easy to fix).
more generally, you could integrate typst with whatever other markup language or framework you’re using. see for example astro-typst.
note that it wouldn’t be practical to use the typst compiler to render math at client-side as it’s several megabytes large. this is a more general opinion, but the much better approach is to either render at server-side (SSR), or statically generate (SSG), which is naturally the approach that typst uses (because it’s a document generator).
i don’t think KaTeX will (or should) be interested in implementing a custom typst parser just to render math. instead, the typst compiler should directly implement better equation output for HTML. but this is probably a ways to go.
given that this seems to be more about the nice syntax than the various other improvements over *TeX, you could use tex2typst to preprocess your typst math into tex math at server-side, then use whatever you want to render this tex code.