⬆️ UPGRADE: myst-parser v0.12 & sphinx v3#226
Conversation
Ensure that the myst-parser configuration and available options are correctly propagated to the myst-nb parser.
Codecov Report
@@ Coverage Diff @@
## master #226 +/- ##
==========================================
+ Coverage 85.42% 85.47% +0.05%
==========================================
Files 9 9
Lines 837 833 -4
==========================================
- Hits 715 712 -3
+ Misses 122 121 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
`myst_amsmath_enable` should be used instead, and the documentation has been updated to reflect that.
|
This PR now removes the MathJax overrides introduced by @choldgraf in #121 (as a quick fix for #99) As discussed previously (e.g. #126 (comment)) these overrides are bad, because (a) they only work for mathjax (e.g. not for katex or imgmath) and (b) they override any configuration set via sphinx (see confval-mathjax_config). @phaustin can you try this out and/or provide some examples of math where there was previously an issue (most of the links you provided in #99 now appear to be dead) |
|
See this page where I have updated the examples: https://myst-nb--226.org.readthedocs.build/en/226/examples/basic.html |
|
Currently for these admonitions and the latex equations, users have to specifically set in conf.py myst_admonition_enable = True
myst_amsmath_enable = TrueI'm not sure if they should be enabled by default? |
|
This is really nice - two quick thoughts: re: making this default I can definitely see how "things that behave like directives but that have markdown inside" could be bracketed with What's the process by which we should decide if this is supported out of the box in MyST? I'd think something like
I think that full process is less important in the early days, but will become more important over time if we want MyST to be a proper "standard" that others use. re: your admonition syntax Where does the ? |
| @@ -1,44 +0,0 @@ | |||
| // Initialize MathJax with the notebook config | |||
There was a problem hiding this comment.
@choldgraf is there anything here you could see as being an issue because we've removed it
There was a problem hiding this comment.
Hmmm I don't think so as long as we have the same behavior for catching math syntax delimeters. The notebook mathjax config is actually pretty non-specific and isn't strongly documented anywhere, so we have a little bit of wiggle room in general, we just don't want to surprise people with MyST's behavior I think. Let's try it out and see if people start complaining :-)
yes thats what it maps to As explained here the underlining implementation is the markdown-it-container plugin, which are also equivalent to pandoc divs. The As mentioned in the docs, because the content is parsed as Markdown, it is not trivial to retrieve actual options (like |
Well thats the only thing it does really lol. But I think that's really important for adoption by joe public, and would certainly like to transition this to be the de facto standard in our documentation
yep something like that sounds good to me |
|
Thanks for those links to the docs. Do we imagine keeping a strict scoping to "container + classes" for the
(apologies if some of this is obvious to you, I'm just thinking out loud to make sure I'm grokking things properly) Also another feeling I just got - are we slowly just converging on "MyST markdown is just Pandoc markdown + |
well it would be more
The ones we dictate lol! |
Well at present you can write: it will just ignore the title |
|
it may not always be a The other one I'm probably going to implement soon is executablebooks/MyST-Parser#208 (comment): Because I think thats another one that would be quite generally useful. but I'm not intending to do any more past that in the near future, unless there is a strong use case.
in a way yes, because we are trying to use "standard" markdown extension syntaxes, which often correlate with pandocc ones. Although moreso its utiling existing markdown-it plugins: https://markdown-it-py.readthedocs.io/en/latest/plugins.html |
Improves subclassing of `MystParser` by `NotebookParser`
|
New in 0.11.2; see https://myst-parser.readthedocs.io/en/latest/using/syntax.html#images for using HTML image tags in Markdown (e.g. |
|
thanks for the ping @chrisjsewell -- I could add some |
cheers @mmcky but you probably don;t need to add any more test cases here, since they are already done in markdown-it-py and myst-parser, and tests would not capture the mathjax side of things. Just have a play around with building the docs here I guess and see if any math you add (latex or dollar) works as expected |
|
hey @chrisjsewell just did some quick testing -- the math is looking pretty great. I added the following |
|
Another thing to check would be what now happens with this issue: jupyter-book/jupyter-book#750 (and this comment particularly jupyter-book/jupyter-book#750 (comment)), and math/latex escaping in general e.g. |
|
thanks for those references @chrisjsewell -- I can do some more extended testing today. re: issue -- inline escapes aren't resolved. with Display Version
$$
p_2 = \$1
$$
See [Issue](https://github.com/executablebooks/jupyter-book/issues/750#issuecomment-653794950)
Inline Version
$p_2 = \$1$
Now for the inline embedded in a paragraph $p_2 = \$1$ with some
additional words and text all around it. additional words and text all around it. |
|
Cheers 😀 |
Ok, I will look to fix this in executablebooks/markdown-it-py#25, but obviously that will be after this PR |



No description provided.