mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-17 12:39:54 +08:00
Add common, terminal, and edit extension points
This commit is contained in:
parent
a92244b7fb
commit
ea95f4101e
@ -223,10 +223,16 @@ def enable_nbextension_python(package, user=False, sys_prefix=False, log=None):
|
||||
for nbext in nbexts:
|
||||
require = nbext['require']
|
||||
section = nbext['section']
|
||||
if section == 'notebook':
|
||||
if section == 'common':
|
||||
diff = {'NotebookApp': {'nbextensions_common': {require: True}}}
|
||||
elif section == 'notebook':
|
||||
diff = {'NotebookApp': {'nbextensions_notebook': {require: True}}}
|
||||
elif section == 'tree':
|
||||
diff = {'NotebookApp': {'nbextensions_tree': {require: True}}}
|
||||
elif section == 'edit':
|
||||
diff = {'NotebookApp': {'nbextensions_edit': {require: True}}}
|
||||
elif section == 'terminal':
|
||||
diff = {'NotebookApp': {'nbextensions_terminal': {require: True}}}
|
||||
_recursive_update(data, diff)
|
||||
_write_config_data(data, user=user, sys_prefix=sys_prefix)
|
||||
|
||||
@ -238,10 +244,16 @@ def disable_nbextension_python(package, user=False, sys_prefix=False):
|
||||
for nbext in nbexts:
|
||||
require = nbext['require']
|
||||
section = nbext['section']
|
||||
if section == 'notebook':
|
||||
if section == 'common':
|
||||
diff = {'NotebookApp': {'nbextensions_common': {require: False}}}
|
||||
elif section == 'notebook':
|
||||
diff = {'NotebookApp': {'nbextensions_notebook': {require: False}}}
|
||||
elif section == 'tree':
|
||||
diff = {'NotebookApp': {'nbextensions_tree': {require: False}}}
|
||||
elif section == 'edit':
|
||||
diff = {'NotebookApp': {'nbextensions_edit': {require: False}}}
|
||||
elif section == 'terminal':
|
||||
diff = {'NotebookApp': {'nbextensions_terminal': {require: False}}}
|
||||
_recursive_update(data, diff)
|
||||
_write_config_data(data, user=user, sys_prefix=sys_prefix)
|
||||
|
||||
@ -498,7 +510,7 @@ class ListNBExtensionsApp(BaseNBExtensionApp):
|
||||
for config_dir in config_dirs:
|
||||
self.log.info('config dir: {}'.format(config_dir))
|
||||
cm = BaseJSONConfigManager(parent=self, config_dir=config_dir)
|
||||
for section in ['notebook', 'tree']:
|
||||
for section in ['common', 'notebook', 'tree', 'edit', 'terminal']:
|
||||
data = cm.get(section)
|
||||
if 'load_extensions' in data:
|
||||
self.log.info(' {} section'.format(section))
|
||||
|
@ -18,6 +18,9 @@ require([
|
||||
requirejs(['custom/custom'], function() {});
|
||||
page = new page.Page();
|
||||
|
||||
var config = new configmod.ConfigSection('terminal',
|
||||
{base_url: utils.get_body_data('baseUrl')});
|
||||
config.load();
|
||||
var common_config = new configmod.ConfigSection('common',
|
||||
{base_url: utils.get_body_data('baseUrl')});
|
||||
common_config.load();
|
||||
@ -49,6 +52,7 @@ require([
|
||||
|
||||
page.show_site();
|
||||
|
||||
utils.load_extensions_from_config(config);
|
||||
utils.load_extensions_from_config(common_config);
|
||||
|
||||
window.onresize = function() {
|
||||
|
Loading…
Reference in New Issue
Block a user