-
Notifications
You must be signed in to change notification settings - Fork 196
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
‼️ BREAKING: Remove dollarmath from default myst_enable_extensions
#505
Conversation
Also, the `tex2jax_ignore mathjax_ignore` classes are only added to the document if the `dollarmath` extension is enabled. Similarly, the mathjax configuration is only overriden if the `dollarmath` extension is enabled.
Codecov Report
@@ Coverage Diff @@
## master #505 +/- ##
==========================================
+ Coverage 89.88% 90.06% +0.18%
==========================================
Files 16 16
Lines 2095 2103 +8
==========================================
+ Hits 1883 1894 +11
+ Misses 212 209 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I think we already agreed this makes sense @choldgraf, @mmcky |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable to me - if I recall, the major discussions were around how supporting dollar math creates a bunch of headaches for parsers and occasionally unexpected behavior in the results?
A couple of quick questions:
- I guess this means that we are changing the "core MyST spec" since we are removing a syntax that was on by default. That's probably fine now since MyST hasn't hit an official "stable" spec yet, but I just wanted to confirm that you all agree that this is what we are doing here. (in the future, this is the kind of thing that an enhancement proposal process might be helpful for)
- Does this mean that the recommended way for
MyST Markdown
to parse math is via a{math}
directive? If so, perhaps that directive should be part of the "core" MyST spec, or alternatively we could decide that MyST doesn't treat mathematics in a special way at all in its core spec (not in this PR, just a note for the future)? - Did we have any of these discussions in a public space that we could cross reference? I can take a look when I have a moment next week but just wanted to mention it in case others know of issues/discussions/etc off-hand
@chrisjsewell @choldgraf -- sorry for my slow response, was on the road yesterday for 13 hours so offline. This is a really useful syntax for a lot of authors. I don't mind if it get's removed from |
Yes this also was already discussed in #399, and you essentially already made part of this change in #385
dollarmath had already been moved to the optional syntax docs page in #385, so this is essentially already the case.
This, in part, depends on what level of compatibility you want with "native" Jupyter Notebook (HTML) interfaces. It is kind of annoying that both sphinx and jupyter load mathjax by default, whose default configuration then "aggressively" converts all
It does not affect jupyter-book, which "hard-codes" the default MyST extensions enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
A few quick responses:
Yes this also was already discussed in #399, and you essentially already made part of this change in #385
Thanks for digging up those links. I've updated the top comment with refs to those issues - just wanted to follow best practices to link back to conversations about stuff.
up-front $ identification in the Markdown parser, is most definitely the better solution, which is what the dollarmath extension does
If Jupyter moved away from marked.js and towards markdown-it, I wonder if this could be handled more gracefully by using a dollarmath extension in markdown-it, that would then render the right syntax for MathJax to process 🤔
cheers
Yep exactly; the "problem" at present, it that MathJax is acting as both a parser and a renderer, For example, this is what https://github.com/executablebooks/markdown-it-dollarmath does On the "python side", even more ideal, would be that you had a python implementation of mathjax/katex. Then the static HTML you generate would already have the math in HTML, and you wouldn't need to be running "dynamic" JavaScript. |
Also, the
tex2jax_ignore mathjax_ignore
classes are only added to the document if thedollarmath
extension is enabled.Similarly, the mathjax configuration is only overriden if the
dollarmath
extension is enabled.References