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

nbsphinx compatability with mathjax3_config['options']['processHtmlClass'] override #394

Closed
awaelchli opened this issue Jun 14, 2021 · 10 comments · Fixed by #395
Closed
Labels
bug Something isn't working

Comments

@awaelchli
Copy link

awaelchli commented Jun 14, 2021

Describe the bug

Yesterday myst parser updated and now warns:

WARNING: `mathjax3_config['options']['processHtmlClass']` is being overridden by myst-parser to tex2jax_process|mathjax_process|math. Set `myst_mathjax_classes = None` if this is undesirable.

Setting `myst_mathjax_classes = None`` as per instruction does not work, and generates another batch of warnings:

WARNING: The config value `myst_mathjax_classes' has type `NoneType', defaults to `str'.
WARNING: myst configuration invalid: 'mathjax_classes' must be <class 'str'> (got None that is a <class 'NoneType'>).
WARNING: `mathjax3_config['options']['processHtmlClass']` is being overridden by myst-parser to tex2jax_process|mathjax_process|math. Set `myst_mathjax_classes = None` if this is undesirable.

The docs explain something here.
I tried also update_mathjax=False and setting values for myst_mathjax_classes=...

Expected behavior

No warning, or a solution to fix the underlying reason why it gets shown.

Environment

  • Python Version [e.g. 3.7.1]: 3.8
  • Package versions or output of jupyter-book --version: x
  • Operating System: macos

Additional context

It is not possible to downgrade to 0.14.0 or sphinx gets uninstalled. Why?

@awaelchli awaelchli added the bug Something isn't working label Jun 14, 2021
@welcome
Copy link

welcome bot commented Jun 14, 2021

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@Borda
Copy link

Borda commented Jun 14, 2021

I can confirm that it starts with the recent 0.15

@chrisjsewell
Copy link
Member

Heya, can you confirm that you do not have any specific configuration for mathjax in your conf.py?

It is not possible to downgrade to 0.14.0 or sphinx gets uninstalled. Why?

It is possible to downgrade; it will also downgrade to sphinx 3, because 0.14 does not support sphinx 4 but should not just uninstall it entirely. If you have any different behaviour, I would raise this with the dependency manager you are using (e.g. pip/conda)

@chrisjsewell
Copy link
Member

or perhaps you are using nbsphinx as well, which also overrides this setting? https://github.com/spatialaudio/nbsphinx/blob/4fb55864ab21487363ad9f9eedcff1730a3325ef/src/nbsphinx.py#L1890

@awaelchli
Copy link
Author

This is our conf.py: https://github.com/PyTorchLightning/pytorch-lightning/blob/master/docs/source/conf.py
I see it is only listed in the extensions but as far as I can see we have no special settings. I can't say why we have it at this moment but will try to figure it out.

And yes it seems we have nbsphinx too

@chrisjsewell
Copy link
Member

chrisjsewell commented Jun 14, 2021

And yes it seems we have nbsphinx too

yeh I'll blame that all on nbsphinx then lol, but I'll have a look at making a change to accommodate it

I tried also update_mathjax=False

Note this should be myst_update_mathjax=False, that should work (although maybe not recommended)

@chrisjsewell chrisjsewell changed the title WARNING: mathjax3_config['options']['processHtmlClass'] is being overridden cannot be turned off nbsphinx compatability with mathjax3_config['options']['processHtmlClass'] override Jun 14, 2021
@Borda
Copy link

Borda commented Jun 14, 2021

yeh I'll blame that all on nbsphinx then lol, but I'll have a look at making a change to accommodate it

so it is about the order as plugins are used?

@awaelchli
Copy link
Author

myst_update_mathjax=False worked (I tried previously update_mathjax=False from the docs). I think we should go with this solution vs. downgrading myst-parser. https://github.com/PyTorchLightning/pytorch-lightning/pull/7967/files

@chrisjsewell
Copy link
Member

chrisjsewell commented Jun 14, 2021

so it is about the order as plugins are used?

No (nbsphinx is after myst-parser in the pytorch extensions), probably the order/priority of events.

Its not really ideal that either package has to override the (global) configuration (there is a long open PR for this sphinx-doc/sphinx#5504), but such is life

Of course, you could always use https://github.com/executablebooks/MyST-NB, which is directly integrated with myst-parser 😉

@awaelchli
Copy link
Author

@chrisjsewell this is resolved for us by myst_update_mathjax=False, unless there is something to address on your side we can close it :) thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants