On Thu, Dec 8, 2011 at 8:44 AM, John W. Foster <jfoster81747(a)gmail.com>wrote;wrote:
I want to build a Template:MathJax page that will
automatically add
the following script call to any page/article that has this template
included.
<script type="text/javascript"
src="
https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-…
">
</script>
You would need to either:
* write an extension to add the actual HTML, and use that from your template
or
* write some JavaScript in your MediaWiki:Common.js to detect your template
and load the MathJax JS
This should be fairly straightforward, something like:
if ($('.mathjax-template').length > 0) {
mw.loader.load('
https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-…
');
}
where your template has a <span class="mathjax-template"> in it or such.
-- brion