From 08e8c5b0230a10b11e93b37874d5cd6750ea7acc 2013-09-27 00:07:38 From: MinRK Date: 2013-09-27 00:07:38 Subject: [PATCH] s/nb_extensions/nbextensions --- diff --git a/IPython/external/mathjax.py b/IPython/external/mathjax.py index f3cfbb6..081f651 100644 --- a/IPython/external/mathjax.py +++ b/IPython/external/mathjax.py @@ -1,6 +1,6 @@ #!/usr/bin/python """Utility function for installing MathJax javascript library into -your IPython nb_extensions directory, for offline use. +your IPython nbextensions directory, for offline use. Authors: @@ -66,7 +66,7 @@ from IPython.utils.path import get_ipython_dir # Where mathjax will be installed -default_dest = os.path.join(get_ipython_dir(), 'nb_extensions', 'mathjax') +default_dest = os.path.join(get_ipython_dir(), 'nbextensions', 'mathjax') # Test for access to install mathjax @@ -128,7 +128,7 @@ def extract_zip(fd, dest): def install_mathjax(tag='v2.2', dest=default_dest, replace=False, file=None, extractor=extract_tar): """Download and/or install MathJax for offline use. - This will install mathjax to the js_extensions dir in your IPYTHONDIR. + This will install mathjax to the nbextensions dir in your IPYTHONDIR. MathJax is a ~15MB download, and ~150MB installed. @@ -137,7 +137,7 @@ def install_mathjax(tag='v2.2', dest=default_dest, replace=False, file=None, ext replace : bool [False] Whether to remove and replace an existing install. - dest : str [IPYTHONDIR/js_extensions] + dest : str [IPYTHONDIR/nbextensions] Where to locally install mathjax tag : str ['v2.2'] Which tag to download. Default is 'v2.2', the current stable release, diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index af2d026..e5d2298 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -170,7 +170,7 @@ class NotebookWebApplication(web.Application): cluster_manager=cluster_manager, # IPython stuff - nb_extensions_path = ipython_app.nb_extensions_path, + nbextensions_path = ipython_app.nbextensions_path, mathjax_url=ipython_app.mathjax_url, config=ipython_app.config, use_less=ipython_app.use_less, @@ -194,7 +194,7 @@ class NotebookWebApplication(web.Application): handlers.extend(load_handlers('services.clusters.handlers')) handlers.extend([ (r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}), - (r"/nb_extensions/(.*)", FileFindHandler, {'path' : settings['nb_extensions_path']}), + (r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}), ]) # prepend base_project_url onto the patterns that we match new_handlers = [] @@ -435,11 +435,11 @@ class NotebookApp(BaseIPythonApplication): """return extra paths + the default location""" return self.extra_static_paths + [DEFAULT_STATIC_FILES_PATH] - nb_extensions_path = List(Unicode, config=True, - help="""paths for Javascript extensions. By default, this is just IPYTHONDIR/nb_extensions""" + nbextensions_path = List(Unicode, config=True, + help="""paths for Javascript extensions. By default, this is just IPYTHONDIR/nbextensions""" ) - def _nb_extensions_path_default(self): - return [os.path.join(get_ipython_dir(), 'nb_extensions')] + def _nbextensions_path_default(self): + return [os.path.join(get_ipython_dir(), 'nbextensions')] mathjax_url = Unicode("", config=True, help="""The url for MathJax.js.""" @@ -451,9 +451,9 @@ class NotebookApp(BaseIPythonApplication): url_path_join(self.base_project_url, "static") ) - # try local mathjax, either in nb_extensions/mathjax or static/mathjax + # try local mathjax, either in nbextensions/mathjax or static/mathjax for (url_prefix, search_path) in [ - (url_path_join(self.base_project_url, "extensions"), self.nb_extensions_path), + (url_path_join(self.base_project_url, "nbextensions"), self.nbextensions_path), (static_url_prefix, self.static_file_path), ]: self.log.debug("searching for local mathjax in %s", search_path)