Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rehype-mathjax: use abstractAdopter instead of jsdomAdaptor / browserAdaptor #41

Open
wooorm opened this issue Apr 20, 2020 · 5 comments
Labels
help wanted 🙏 This could use your insight or help 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have

Comments

@wooorm
Copy link
Member

wooorm commented Apr 20, 2020

Problem

JsDom is heavy, and an alternative to rehype, which we’re already using. It’s probably better to use AbstractAdopter and map it to hast, instead of using jsdomAdaptor / browserAdaptor to create a DOM and then transform that to hast.

Expected behaviour

Directly do mathjax -> hast, instead of mathjax -> dom -> hast

@wooorm wooorm added 🦋 type/enhancement This is great to have 🙉 open/needs-info This needs some more info labels Apr 20, 2020
@BarryThePenguin BarryThePenguin changed the title rehype-mathjax: use lightAdaptor instead of jsdomAdaptor / browserAdaptor rehype-mathjax: use liteAdaptor instead of jsdomAdaptor / browserAdaptor Apr 20, 2020
@tani
Copy link
Contributor

tani commented Apr 20, 2020

lightAaptor is also adaptor for lightDOM. Thus, mathjax -> dom -> hast is not changed.
If you want to do that, we should implement AbstractDOMAdopter abstract class to hast instead.
https://github.com/mathjax/MathJax-src/blob/5e9a5c66de610dd754a0377b278892ae4f007058/ts/core/DOMAdaptor.ts#L343

@wooorm
Copy link
Member Author

wooorm commented Apr 20, 2020

Oh great, that looks better! I couldn’t find any docs on these things 🤔 is there some place where you find these things, or is it reading the code too?

@wooorm wooorm changed the title rehype-mathjax: use liteAdaptor instead of jsdomAdaptor / browserAdaptor rehype-mathjax: use abstractAdopter instead of jsdomAdaptor / browserAdaptor Apr 20, 2020
@tani
Copy link
Contributor

tani commented Apr 20, 2020

I've just read the code. Currently, the developers guide of MathJax is under construction. https://docs.mathjax.org/en/latest/api/direct.html

@wooorm wooorm added the help wanted 🙏 This could use your insight or help label May 30, 2020
@wooorm
Copy link
Member Author

wooorm commented Jun 25, 2020

Was looking at this some more today, I won’t have a lot of time to work on it, but I think it would be a very valuable feature. @tani, is this something you could take on? Or someone else?

@wooorm
Copy link
Member Author

wooorm commented Aug 22, 2020

@tani was that 🚀 a yes? ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 This could use your insight or help 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have
Development

No branches or pull requests

2 participants