only scrub SVG output

which is the largest

rather than white-listing HTML-CSS.
This means the various other renderers (perhaps most importantly, MML) are available, not just HTML-CSS

This increases the size of a notebook install by ~800k/19MB or 5%.

Alternately, we could *only* add MML, which would have a negligible affect on install size.
This commit is contained in:
Min RK 2016-02-06 20:34:19 +01:00
parent 4d64519f12
commit b3cab90e9a
2 changed files with 20 additions and 9 deletions

View File

@ -29,9 +29,11 @@ define([
styles: {'.MathJax_Display': {"margin": 0}},
linebreaks: { automatic: true }
},
MathMenu: {
showRenderer: false,
},
});
MathJax.Hub.Register.StartupHook("MathMenu Ready", function () {
var renderers = MathJax.Menu.menu.Find("Math Settings").submenu.Find("Math Renderer").submenu;
// disable SVG output, which we don't ship
renderers.Find("SVG").disabled = true;
});
MathJax.Hub.Configured();
} else if (window.mathjax_url !== "") {

View File

@ -158,21 +158,30 @@ def find_package_data():
mj('MathJax.js'),
mj('config', 'TeX-AMS_HTML-full.js'),
mj('config', 'Safe.js'),
mj('extensions', 'Safe.js'),
mj('jax', 'output', 'HTML-CSS', '*.js'),
])
for tree in [
trees = []
mj_out = mj('jax', 'output')
for output in os.listdir(mj_out):
if output == 'SVG':
# strip SVG output
continue
path = pjoin(mj_out, output)
static_data.append(pjoin(path, '*.js'))
autoload = pjoin(path, 'autoload')
if os.path.isdir(autoload):
trees.append(autoload)
for tree in trees + [
mj('localization'), # limit to en?
mj('fonts', 'HTML-CSS', 'STIX-Web', 'woff'),
mj('extensions', 'TeX'),
mj('extensions'),
mj('jax', 'input', 'TeX'),
mj('jax', 'output', 'HTML-CSS', 'autoload'),
mj('jax', 'output', 'HTML-CSS', 'fonts', 'STIX-Web'),
]:
for parent, dirs, files in os.walk(tree):
for f in files:
static_data.append(pjoin(parent, f))
os.chdir(os.path.join('tests',))
js_tests = glob('*.js') + glob('*/*.js')