Open gdagosto opened 7 months ago
While it worked for some really basic expressions, the fact that both Svelte and KaTeX use curly braces is troublesome. Svelte tries to evaluate expressions like \sum_{i=1}
and fails because of ReferenceError: i is not defined
@mihar-22 The code is ready, but I still need to write docs for it, which I'll do if you decide that the PR is ok.
You can see it working within the demo app, via this link.
Lemme know if I can move forward and write the docs for it, thanks!
I made the dependencies optional as to not bloat kit-docs with unecessary dependencies. This way, if an user needs math expressions, he can just install some optional dependencies and support is already there.
In order to use mathematical expressions, one would need to:
markdown-it-texmath
as a project dependencykatex
as a project dependencyTo add styling, one would need to:
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css"
integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV"
crossorigin="anonymous"
/>
Adds another markdown-it plugin, markdown-it-texmath, which supports mathematical expressions via KaTeX.