What does HackerNews think of tikzjax?

TikZJax is TikZ running under WebAssembly in the browser

Language: JavaScript

Do you want the TeX code to be converted to svg in the browser at rendering time or are you ok with converting the figures to svg beforehand and including them in your html files?

For the former I would look at TikZjaX (https://github.com/kisonecat/tikzjax) which takes tikz code and convert it to svg on the fly, just like MathJaX converting TeX equations. It may be slow, though, especially for complicated plots.

If you are OK with creating the figures beforehand and serving the generated svg, there are several options: Asymptote (https://asymptote.sourceforge.io/) can generate svg and even html files that you can embed in an iframe. You can convert any TeX figure to svg with dvisvgm (play with the --font-format option). If you insists on using pstricks, I am pretty sure you can convert a resulting postscript file to svg as well. If you are using metapost, then mptopdf will convert metapost source to pdf, which you can then convert to svg.

You might also be interested in tikzjax (https://github.com/kisonecat/tikzjax) for diagrams which works "good enough".

I use them together but there is a pretty noticeable delay with tikzjax - I'm not sure of any alternatives at this point.

No need for (much) CSS, browsers already support vector graphics: SVG!

In Pandoc, what you would do is you would use a general Latex plugin, and then TikZ supports PNG or SVG output by 'standalone' (https://tex.stackexchange.com/questions/51757/how-can-i-use-...), and you can either save that to a file & use as an image or you can inline them.

This uses Latex at compile-time, but considering the extent to which TikZ is a graphics DSL, I wonder how hard it would be to implement a TikZ->SVG compiler as a standalone tool in a different language? (Or make it available in a variant like Mathjax? Like https://github.com/kisonecat/tikzjax except without running an entire TeX engine in the user's browser.)

Apropos "[...] for Everything", https://github.com/kisonecat/tikzjax might be of interest. It uses a WebAssembly copy of tex.

Regrettably neither KaTeX nor MathJax support category theory diagrams. And I'd like to try making interactive diagrams, to explore using mouseover supplements to reduce the learner cognitive burden of keeping track of all the moving pieces and their significance. Perhaps they might be combined with a generic js diagram library... but it doesn't look like anyone has bushwacked that path.