mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-15 04:00:34 +08:00
Add option to not use minified javascript and ease developpement.
This commit is contained in:
parent
6bd83883a3
commit
f9ad56e206
@ -23,3 +23,10 @@ You can then build the Javascript and CSS by running::
|
||||
|
||||
This will automatically fetch the remaining dependencies (bower, less) and
|
||||
install them in a subdirectory.
|
||||
|
||||
For quick iteration on the Notebook's Javascript you can deactivate the use of
|
||||
the bundled and minified Javacript by using the option
|
||||
``--NotebookApp.ignore_minified_js=True``. This might though highly increase the
|
||||
number of requests that the browser make to the server, but can allow to test
|
||||
Javascript file modification without going through the compilation step that
|
||||
can take up to 30 sec.
|
||||
|
@ -117,7 +117,16 @@ class IPythonHandler(AuthenticatedHandler):
|
||||
|
||||
Mostly property shortcuts to IPython-specific settings.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@property
|
||||
def ignore_minified_js(self):
|
||||
"""Wether to user bundle in template. (*.min files)
|
||||
|
||||
Mainly use for development and avoid file recompilation
|
||||
"""
|
||||
return self.settings.get('ignore_minified_js', True)
|
||||
|
||||
@property
|
||||
def config(self):
|
||||
return self.settings.get('config', None)
|
||||
@ -261,6 +270,7 @@ class IPythonHandler(AuthenticatedHandler):
|
||||
sys_info=sys_info,
|
||||
contents_js_source=self.contents_js_source,
|
||||
version_hash=self.version_hash,
|
||||
ignore_minified_js=self.ignore_minified_js,
|
||||
**self.jinja_template_vars
|
||||
)
|
||||
|
||||
|
@ -186,6 +186,7 @@ class NotebookWebApplication(web.Application):
|
||||
'no_cache_paths': [url_path_join(base_url, 'static', 'custom')],
|
||||
},
|
||||
version_hash=version_hash,
|
||||
ignore_minified_js=ipython_app.ignore_minified_js,
|
||||
|
||||
# authentication
|
||||
cookie_secret=ipython_app.cookie_secret,
|
||||
@ -397,6 +398,11 @@ class NotebookApp(JupyterApp):
|
||||
# create requested profiles by default, if they don't exist:
|
||||
auto_create = Bool(True)
|
||||
|
||||
ignore_minified_js = Bool(False,
|
||||
config=True,
|
||||
help='Use minified JS file or not, mainly use during dev to avoid JS recompilation',
|
||||
)
|
||||
|
||||
# file to be opened in the notebook server
|
||||
file_to_run = Unicode('', config=True)
|
||||
|
||||
|
@ -328,6 +328,10 @@ data-notebook-path="{{notebook_path}}"
|
||||
|
||||
<script src="{{ static_url("components/text-encoding/lib/encoding.js") }}" charset="utf-8"></script>
|
||||
|
||||
<script src="{{ static_url("notebook/js/main.min.js") }}" charset="utf-8"></script>
|
||||
{% if ignore_minified_js %}
|
||||
<script src="{{ static_url("notebook/js/main.js") }}" charset="utf-8"></script>
|
||||
{% else %}
|
||||
<script src="{{ static_url("notebook/js/main.min.js") }}" charset="utf-8"></script>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user