-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.ts
46 lines (36 loc) · 1.26 KB
/
plugin.ts
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
// Copyright (c) Will Epperson
// Distributed under the terms of the Modified BSD License.
import type {
JupyterFrontEnd,
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { IJupyterWidgetRegistry } from '@jupyter-widgets/base';
import * as widgetExports from './widget';
import { MODULE_NAME, MODULE_VERSION } from './version';
// import { INotebookTracker } from '@jupyterlab/notebook';
const EXTENSION_ID = 'diginlineprofiler:plugin';
/**
* The example plugin.
*/
const extension: JupyterFrontEndPlugin<void> = {
id: EXTENSION_ID,
requires: [IJupyterWidgetRegistry], // INotebookTracker],
activate: (app: JupyterFrontEnd, registry: IJupyterWidgetRegistry) => { // nbtracker: INotebookTracker) => {
console.log("activating extension")
registry.registerWidget({
name: MODULE_NAME,
version: MODULE_VERSION,
exports: widgetExports,
});
// emitted when the user's notebook changes I think...
// notebookTracker.currentChanged.connect((_, widget) => {
// console.log(">>>>>>>>Notebook changed>>>>>>>>")
// const notebook = new NotebookAPI(widget);
// notebook.ready.then(async () => {
// logger.setNoteook(notebook);
// });
// });
},
autoStart: true,
};
export default extension;