forked from jupyterlab/jupyterlab-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (41 loc) · 1.48 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require('es6-promise/auto'); // polyfill Promise on IE'
var app = require('@jupyterlab/application').JupyterLab;
var PageConfig = require('@jupyterlab/coreutils').PageConfig;
__webpack_public_path__ = PageConfig.getOption('publicUrl');
require('font-awesome/css/font-awesome.min.css');
require('@jupyterlab/default-theme/style/index.css');
function main() {
var version = PageConfig.getOption('appVersion') || 'unknown';
var name = PageConfig.getOption('appName') || 'JupyterLab';
var namespace = PageConfig.getOption('appNamespace') || 'jupyterlab';
var devMode = PageConfig.getOption('devMode') || 'false';
var settingsDir = PageConfig.getOption('settingsDir') || '';
var assetsDir = PageConfig.getOption('assetsDir') || '';
if (version[0] === 'v') {
version = version.slice(1);
}
lab = new app({
namespace: namespace,
name: name,
version: version,
devMode: devMode.toLowerCase() === 'true',
settingsDir: settingsDir,
assetsDir: assetsDir
});
{{#each jupyterlab_extensions}}
try {
lab.registerPluginModule(require('{{this}}'));
} catch (e) {
console.error(e);
}
{{/each}}
var ignorePlugins = [];
try {
var option = PageConfig.getOption('ignorePlugins');
ignorePlugins = JSON.parse(option);
} catch (e) {
console.error("Invalid ignorePlugins config:", option);
}
lab.start({ "ignorePlugins": ignorePlugins });
}
window.onload = main;