Created
December 10, 2011 19:24
-
-
Save juliantaylor/1456031 to your computer and use it in GitHub Desktop.
use system mathjax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py | |
index e7a00c0..7b60934 100644 | |
--- a/IPython/frontend/html/notebook/notebookapp.py | |
+++ b/IPython/frontend/html/notebook/notebookapp.py | |
@@ -105,6 +105,11 @@ class NotebookWebApplication(web.Application): | |
(r"/notebooks/%s" % _notebook_id_regex, NotebookHandler), | |
(r"/rstservice/render", RSTHandler) | |
] | |
+ | |
+ if os.path.exists("/usr/share/javascript/mathjax/MathJax.js"): | |
+ handlers.append((r"/mathjax/(.*)", web.StaticFileHandler, | |
+ {"path": "/usr/share/javascript/mathjax"})) | |
+ | |
settings = dict( | |
template_path=os.path.join(os.path.dirname(__file__), "templates"), | |
static_path=os.path.join(os.path.dirname(__file__), "static"), | |
@@ -265,7 +270,10 @@ class NotebookApp(BaseIPythonApplication): | |
if not self.enable_mathjax: | |
return u'' | |
static_path = os.path.join(os.path.dirname(__file__), "static") | |
- if os.path.exists(os.path.join(static_path, 'mathjax', "MathJax.js")): | |
+ if os.path.exists("/usr/share/javascript/mathjax/MathJax.js"): | |
+ self.log.info("Using system MathJax") | |
+ return u"mathjax/MathJax.js" | |
+ elif os.path.exists(os.path.join(static_path, 'mathjax', "MathJax.js")): | |
self.log.info("Using local MathJax") | |
return u"static/mathjax/MathJax.js" | |
else: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment