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

[WIP]: BLD, MAINT: Configure MathJax v3 #2

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

agriyakhetarpal
Copy link

@agriyakhetarpal agriyakhetarpal commented May 6, 2024

Description

As described in scipy/scipy#20518, I'm trying to update SciPy's internal/vendored MathJax submodule, which is coming from this repository on GitHub, to use MathJax v3.

It is to be noted that the MathJax project underwent a lot of changes through v2 and v3 because of a complete rewrite of the source code, which renders the Gruntfile no longer applicable for removing ancillary files, and possibly could be no longer valid since MathJax has undergone several quality-of-life changes and fixes. A migration guide is available, and I will be using this converter to convert from the older MathJax.Hub.Config entry point to the newer configuration block. It seems like it would be too much work to adapt the Gruntfile to work with v3 for MathJax, hence, a solution is to manually analyse needed files and copy them into this repository for being able to run MathJax. The converter is not fully compliant and does not work fully because of known issues, so, the rest of the configuration will have to be configured separately.

Additional context

scipy/scipy#20518 (comment) describes the reasons towards implementing this (mostly security reasons in order to avoid CVEs that were discovered in v2.7.1 and v2.7.4; subsequently up to v2.7.9 and no longer present in v3).

@agriyakhetarpal
Copy link
Author

agriyakhetarpal commented May 6, 2024

To make this PR easier for review:

8c516d4 and c5a6e9e remove the original files from v2, and dbda1db adds new ones from v3. There are very few matches between the old and the new files.

Some fonts exist in es5/output/chtml/fonts/woff-v2 some of which were previously removed by the Gruntfile earlier, but I am not sure which fonts will be needed in this case since the names are different; I haven't removed them in a commit so far.

I would appreciate help with proceeding with further changes, since this is currently not complete – it's certainly doable to minimise a v3 distribution of MathJax.

Some other files that can be removed are the non-English locale files and folders in es5/sre/mathjmaps/. SciPy makes available both the CHTML and the SVG renderers, so I would suggest keeping associated files for both of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant