benrbray / prosemirror-math

Schema and plugins for "first-class" math support in ProseMirror!
https://benrbray.com/prosemirror-math/
MIT License
249 stars 35 forks source link

Support MathJax and other math renderers #4

Open benrbray opened 3 years ago

benrbray commented 3 years ago

KaTeX is the preferred math rendering engine, but prosemirror-math should provide a render() callback in case users would like to use something else.

stefnotch commented 3 years ago

Would this also include WYSIWYG math editors such as mathlive? (Mathlive is a pretty decent maths editor and the lead developer is also working on other mathematical things for the web) Another potentially quite interesting WYSIWYG would be guppy, which builds on top of KaTeX.

Or is this purely limited to the rendering aspect and editing will remain text based?

benrbray commented 3 years ago

MathLive is a great project! I haven't heard of guppy before, it looks interesting as well.

At the moment, the main use case for prosemirror-math is when you want to render math (via KaTeX, MathJax, etc) based on raw text entered by the user. Much of the code for prosemirror-math is about handling strange edge cases related to the fact that there's a nested ProseMirror editor inside the NodeView. Since MathLive and guppy have their own editing interface, I think wrapping them in a NodeView would present an entirely different set of challenges than the use case prosemirror-math is designed for. In some ways it's probably easier, since those packages handle both input AND rendering all at once.

So at the moment I don't really think that it makes sense to set MathLive / guppy integration as a goal for prosemirror-math.

You might be interested in work by Demos on integrating MathQuill into ProseMirror.

stefnotch commented 3 years ago

Alright, that makes sense. I already expected that to be a bit out of scope for this project, but asking never hurts :) Thanks for pointing me the work that Desmos is doing! I'll check that out

slevey087 commented 1 year ago

Just wanted to +1 the MathJax request :)