mathjax / MathJax-dev

Build and release tools for the MathJax project
www.mathjax.org
33 stars 26 forks source link

[combined configurations] Add the Menu extension from the MathJax Accessibility tools #20

Closed pkra closed 3 years ago

pkra commented 8 years ago

I.e. load https://github.com/mathjax/MathJax-a11y/blob/master/extensions/accessibility-menu.js from the third party extension repository.

dpvc commented 8 years ago

I was looking into this, and I thought of something that might be a problem. When we do this, that will mean that the combined configurations can't be used as stand-alone configurations (for off-line work), as they will all call on the CDN for [Contrib]. I don't see an easy way out of this, other than to provide either a convenient method of removing the extension during the configuration process (there isn't one now), or another configuration parameter that would ignore [Contrib] extensions (e.g., something that indicates off-line work). Otherwise, for stand-alone situations, y9ou would have to use a custom configuration.

@pkra, @zorkow, any comments or suggestions?

dpvc commented 8 years ago

The solution that I have worked out is to use another option on the script call that loads MathJax.js to control this. E.g.

<script src="/mathjax/MathJax.js?config=TeX-AMS_CHTML&contrib=false"></script>

So that &contrib=false would (silently) prevent any files from being loaded from [Contrib]. This would mean the combined configuration files could be loaded locally without calling on the CDN for the extra menu without error messages or delays, but at the loss of the accessibility menus.

How does that sound?

dpvc commented 8 years ago

Maybe &contrib=ignore would be better?

pkra commented 8 years ago

That sounds great! I'd pick ignore but both are fine, I think.

dpvc commented 8 years ago

Even better, how about just &noContrib? So that it is

<script src="/mathjax/MathJax.js?config=TeX-AMS_CHTML&noContrib"></script>
dpvc commented 8 years ago

There are already several other parameters that I don't think are documented anywhere. The config parameter is certainly documented, but there is also locale=... (e.g., locale=fr), delayStartupUntil=... (which can be set to none, onload or configured), noDOMContentEvent (which is obsolete now, but was a way around using the DOMContentLoaded event to start MathJax's processing phase, when that was less well supported), and NoMathPlayer (which prevented MathJax from trying to use MathPlayer even if it was available). And now noContrib.

pkra commented 8 years ago

Even better, how about just &noContrib?

Sound good.

There are already several other parameters that I don't think are documented anywhere.

I'll make an issue