Page MenuHomePhabricator

Use custom CDN if possible for Jupyter HTML exported notebooks
Open, MediumPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Open your network inspector in developer tools on your browser or proxy.

Visit an HTML export of a Jupyter notebook, such as https://people.wikimedia.org/~dr0ptp4kt/❤️.html .

What happens?:

The HTML notebook loads scripts from the Cloudflare CDN.

What should have happened instead?:

Ideally the JS is loaded from a pinned version on the same origin or a Wikimedia CDN.

Software version (skip for WMF-hosted wikis like Wikipedia):

I haven't looked terribly closely upstream, but this probably results from stuff in this vicinity:

https://github.com/jupyter/nbconvert/blob/e4fa6287916f9a928e5449598495fb0a96e00ddf/share/templates/base/mathjax.html.j2

https://github.com/jupyter/nbconvert/blob/e4fa6287916f9a928e5449598495fb0a96e00ddf/nbconvert/exporters/html.py#L109

The URLs may be somewhat configurable via https://nbconvert.readthedocs.io/en/latest/config_options.html .