-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ts
52 lines (43 loc) · 1.19 KB
/
index.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
46
47
48
49
50
51
52
import {
JupyterFrontEnd, JupyterFrontEndPlugin
} from '@jupyterlab/application';
import {
NotebookTools, INotebookTracker
} from '@jupyterlab/notebook';
import {
IDocumentManager
} from '@jupyterlab/docmanager';
/**
* The plugin registration information.
*/
const plugin: JupyterFrontEndPlugin<void> = {
activate: (
app: JupyterFrontEnd,
tracker: INotebookTracker,
docmanager: IDocumentManager,
) => {
new OrchestIntegrationExtension(tracker, app, docmanager);
},
id: 'orchestintegration:orchestintegrationPlugin',
autoStart: true,
requires: [INotebookTracker, IDocumentManager]
};
declare global {
interface Window { _orchest_app: JupyterFrontEnd; _orchest_tracker: INotebookTracker; _orchest_docmanager: IDocumentManager}
}
/**
* A notebook extension that adds visual cell tags to Notebook cells.
*/
export
class OrchestIntegrationExtension extends NotebookTools.Tool {
constructor(tracker: INotebookTracker, app: JupyterFrontEnd, docmanager: IDocumentManager) {
super();
window._orchest_app = app;
window._orchest_tracker = tracker;
window._orchest_docmanager = docmanager;
}
}
/**
* Export the plugin as default.
*/
export default plugin;