MacDownApp / macdown

Open source Markdown editor for macOS.
https://macdown.uranusjr.com/
9.43k stars 1.09k forks source link

Switch to KaTeX and server-side math rendering #162

Open uranusjr opened 10 years ago

uranusjr commented 10 years ago

KaTeX By Khan Academy is a new math-typesetting library implemented completely with JavaScript and CSS. It is much faster than MathJax (which we currently use for math rendering), has much cleaner dependency, and can be bundled pretty cleanly inside a page, thus not requiring Internet connection.

Even better, it can do server-side rendering. Hoedown 3.0 will get first-class math syntax support, and combining a math callback with JavaScriptCore it should be possible to completely eliminate post-rendering callbacks needed by MathJax. Also, by bundling the rendering library we can also bundle the fonts, boosting performance even further (with less than 1 MB increase in bundle size).

The most obvious disadvantage at the current moment is TeX compatibility. KaTeX supports quite a lot already, but still much less than MathJax. But with any luck it should catch up pretty quickly.

Please comment if there’s anything you would like to add, or if you think this is a splendid/great/meh/bad/terrible idea. My current plan is to evaluate this again after Hoedown 3.0 is publicly available, and start the migration soon after we upgrade to it.

hszcg commented 10 years ago

Faster is always better. looking forward to see KaTeX live!

RoyiAvital commented 8 years ago

Hi, Could you please not "Replace" but add? Let the user chose Speed or Features.

Thank You.