svelteness / kit-docs

Documentation integration for SvelteKit.
https://kitdocs.vercel.app
MIT License
457 stars 32 forks source link

feat: add mathematical expressions support #97

Open gdagosto opened 7 months ago

gdagosto commented 7 months ago

Adds another markdown-it plugin, markdown-it-texmath, which supports mathematical expressions via KaTeX.

gdagosto commented 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

gdagosto commented 7 months ago

@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!

gdagosto commented 7 months ago

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:

To add styling, one would need to: