Show More
@@ -21,7 +21,9 b' From the command line:' | |||
|
21 | 21 | |
|
22 | 22 | To a specific location: |
|
23 | 23 | |
|
24 |
$ python -m IPython.external.mathjax -i /usr/share/ |
|
|
24 | $ python -m IPython.external.mathjax -i /usr/share/ | |
|
25 | ||
|
26 | will install mathjax to /usr/share/mathjax | |
|
25 | 27 | |
|
26 | 28 | To install MathJax from a file you have already downloaded: |
|
27 | 29 | |
@@ -39,7 +41,7 b' To find the directory where IPython would like MathJax installed:' | |||
|
39 | 41 | |
|
40 | 42 | |
|
41 | 43 | #----------------------------------------------------------------------------- |
|
42 |
# Copyright (C) 20 |
|
|
44 | # Copyright (C) 2011 The IPython Development Team | |
|
43 | 45 | # |
|
44 | 46 | # Distributed under the terms of the BSD License. The full license is in |
|
45 | 47 | # the file COPYING, distributed as part of this software. |
@@ -66,7 +68,8 b' from IPython.utils.path import get_ipython_dir' | |||
|
66 | 68 | |
|
67 | 69 | # Where mathjax will be installed |
|
68 | 70 | |
|
69 |
|
|
|
71 | nbextensions = os.path.join(get_ipython_dir(), 'nbextensions') | |
|
72 | default_dest = os.path.join(nbextensions, 'mathjax') | |
|
70 | 73 | |
|
71 | 74 | # Test for access to install mathjax |
|
72 | 75 | |
@@ -87,7 +90,10 b' def prepare_dest(dest, replace=False):' | |||
|
87 | 90 | shutil.rmtree(dest) |
|
88 | 91 | return True |
|
89 | 92 | else: |
|
90 | print "MathJax apparently already installed at %s" % dest | |
|
93 | mathjax_js = os.path.join(dest, 'MathJax.js') | |
|
94 | if not os.path.exists(mathjax_js): | |
|
95 | raise IOError("%s exists, but does not contain MathJax.js" % dest) | |
|
96 | print "%s already exists" % mathjax_js | |
|
91 | 97 | return False |
|
92 | 98 | else: |
|
93 | 99 | return True |
@@ -137,8 +143,8 b" def install_mathjax(tag='v2.2', dest=default_dest, replace=False, file=None, ext" | |||
|
137 | 143 | |
|
138 | 144 | replace : bool [False] |
|
139 | 145 | Whether to remove and replace an existing install. |
|
140 | dest : str [IPYTHONDIR/nbextensions] | |
|
141 |
Where to |
|
|
146 | dest : str [IPYTHONDIR/nbextensions/mathjax] | |
|
147 | Where to install mathjax | |
|
142 | 148 | tag : str ['v2.2'] |
|
143 | 149 | Which tag to download. Default is 'v2.2', the current stable release, |
|
144 | 150 | but alternatives include 'v1.1a' and 'master'. |
@@ -176,8 +182,8 b' def main():' | |||
|
176 | 182 | parser.add_argument( |
|
177 | 183 | '-i', |
|
178 | 184 | '--install-dir', |
|
179 |
default= |
|
|
180 | help='custom installation directory') | |
|
185 | default=nbextensions, | |
|
186 | help='custom installation directory. Mathjax will be installed in here/mathjax') | |
|
181 | 187 | |
|
182 | 188 | parser.add_argument( |
|
183 | 189 | '-d', |
@@ -196,7 +202,7 b' def main():' | |||
|
196 | 202 | |
|
197 | 203 | pargs = parser.parse_args() |
|
198 | 204 | |
|
199 | dest = pargs.install_dir | |
|
205 | dest = os.path.join(pargs.install_dir, 'mathjax') | |
|
200 | 206 | |
|
201 | 207 | if pargs.print_dest: |
|
202 | 208 | print dest |
General Comments 0
You need to be logged in to leave comments.
Login now