10000 MAINT: switch documentation build from mathjax to imgmath by pv · Pull Request #7358 · scipy/scipy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: switch documentation build from mathjax to imgmath #7358

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

Closed
wants to merge 7 commits into from

Conversation

pv
Copy link
Member
@pv pv commented Apr 30, 2017

The Mathjax CDN was retired Apr 30 2017, https://www.mathjax.org/cdn-shutting-down/
I'm not sure if it makes sense for us to rely on 3rd party CDNs for the documentation.

Mathjax itself is quite big, so rather than bundling it, it probably
makes more sense to ship SVG versions of the math formulas instead,
using sphinx.ext.imgmath. This produces 19M of svg images, but that's probably
preferable to the 100+M of mathjax.

This PR doesn't solve the problem that math formulas in previously built docs
will stop displaying properly at some point, but fixing that would need rebuilds.

Fixes gh-7286

circleci: https://circle-artifacts.com/gh/scipy/scipy/2707/artifacts/0/home/ubuntu/scipy/doc/build/html-scipyorg/index.html

@pv pv force-pushed the imgmath branch 3 times, most recently from 60d3d9a to 2c66f2c Compare April 30, 2017 17:13
@ev-br
Copy link
Member
ev-br commented May 2, 2017

I actually wonder what arxiv/math.SE et al do. (Non-blocking, +1 for the PR itself)

@pv
Copy link
Member Author
pv commented May 2, 2017 via email

@pv
Copy link
Member Author
pv commented May 2, 2017

It's possible to strip mathjax down apparently, so maybe that could be investigated also.

@ev-br
Copy 8000 link
Member
ev-br commented May 2, 2017

What is the bus factor for fiddling around with JS libs?

MathJax looked great while it was a single line in the conf.py, but anything seriously beyond that, and it's not that clear-cut anymore.

@pv
Copy link
Member Author
pv commented May 2, 2017

They have some sort of (semi-official?) script that prunes out cruft.
It's possible to muck up something based on that: https://github.com/pv/scipy-mathjax/commit/bfe57bf1358b767921dca6f7dd36801b5bbbc50e

The problem with imgmath is that png images don't scale, and svg images don't align on the text baseline, so it looks a bit crappy with either output format, whereas mathjax looks nicer.

@pv
Copy link
Member Author
pv commented May 4, 2017

I'm going to go with the bundled mathjax.

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.

Mathjax cdn shutting down, sphinx config needs update
2 participants
0