This is a really simple KaTeX theme component for Discourse.
It stuffs all the necessary bits at the end of </head>
.
It loads all KaTeX and CSS (currently v0.10.0) from the jsdelivr CDN.
It then uses the Discourse theme API api.decorateCooked
to update the content of posts.
NOTE: I have deviated from the default KaTeX and use the delimeters $$
for inline LaTeX and $$$
for block LaTeX.
But you can edit the options of the KaTeX function pretty easily from the theme editor.