Georg Brandl avatar Georg Brandl committed f54384e

Closes #683: set default MathJax path to the CDN URL, and update the docs accordingly.

Comments (0)

Files changed (2)

 the browser.
 
 Because MathJax (and the necessary fonts) is very large, it is not included in
-Sphinx.  You must install it yourself, and give Sphinx its path in this config
-value:
+Sphinx.
 
 .. confval:: mathjax_path
 
    The path to the JavaScript file to include in the HTML files in order to load
-   JSMath.  There is no default.
+   JSMath.
+
+   The default is the ``http://`` URL that loads the JS files from the `MathJax
+   CDN <http://www.mathjax.org/docs/1.1/start.html>`_.  If you want MathJax to
+   be available offline, you have to donwload it and set this value to a
+   different path.
 
    The path can be absolute or relative; if it is relative, it is relative to
    the ``_static`` directory of the built docs.
    documentation set on one server, it is advisable to install MathJax in a
    shared location.
 
-   You can also give a full ``http://`` URL.  Kevin Dunn maintains a MathJax
-   installation on a public server, which he offers for use by development and
-   production servers::
-
-      mathjax_path = 'http://mathjax.connectmv.com/MathJax.js'
+   You can also give a full ``http://`` URL different from the CDN URL.
 
 
 :mod:`sphinx.ext.jsmath` -- Render math via JavaScript

sphinx/ext/mathjax.py

 
 def setup(app):
     mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
-    app.add_config_value('mathjax_path', '', False)
+    app.add_config_value('mathjax_path',
+                         'http://cdn.mathjax.org/mathjax/latest/MathJax.js?'
+                         'config=TeX-AMS-MML_HTMLorMML', False)
     app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
     app.add_config_value('mathjax_display', [r'\[', r'\]'], 'html')
     app.connect('builder-inited', builder_inited)
-
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.