Skip to content

Commit

Permalink
Update for JupyterLab 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-r-rose committed Feb 5, 2019
1 parent 96e3785 commit f34950c
Show file tree
Hide file tree
Showing 4 changed files with 372 additions and 176 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Here is an animation showing the extension's use, with a notebook from the

## Prerequisites

- JupyterLab v0.35
- JupyterLab 1.0

## Installation

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupyterlab/toc",
"version": "0.6.0",
"version": "1.0.0",
"private": false,
"description": "Table of Contents extension for JupyterLab",
"keywords": [
Expand Down Expand Up @@ -32,15 +32,15 @@
"watch": "tsc -w"
},
"dependencies": {
"@jupyterlab/application": "^0.19.1",
"@jupyterlab/apputils": "^0.19.1",
"@jupyterlab/cells": "^0.19.1",
"@jupyterlab/coreutils": "^2.2.1",
"@jupyterlab/docmanager": "^0.19.1",
"@jupyterlab/docregistry": "^0.19.1",
"@jupyterlab/fileeditor": "^0.19.1",
"@jupyterlab/notebook": "^0.19.1",
"@jupyterlab/rendermime": "^0.19.1",
"@jupyterlab/application": "^1.0.0-alpha.3",
"@jupyterlab/apputils": "^1.0.0-alpha.3",
"@jupyterlab/cells": "^1.0.0-alpha.3",
"@jupyterlab/coreutils": "3.0.0-alpha.3",
"@jupyterlab/docmanager": "^1.0.0-alpha.3",
"@jupyterlab/docregistry": "^1.0.0-alpha.3",
"@jupyterlab/fileeditor": "^1.0.0-alpha.3",
"@jupyterlab/notebook": "^1.0.0-alpha.4",
"@jupyterlab/rendermime": "^1.0.0-alpha.3",
"@phosphor/algorithm": "^1.1.2",
"@phosphor/coreutils": "^1.3.0",
"@phosphor/messaging": "^1.2.2",
Expand Down
15 changes: 9 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// Distributed under the terms of the Modified BSD License.

import {
ILabShell,
ILayoutRestorer,
IMimeDocumentTracker,
JupyterLab,
JupyterLabPlugin
JupyterFrontEnd,
JupyterFrontEndPlugin
} from '@jupyterlab/application';

import { IDocumentManager } from '@jupyterlab/docmanager';
Expand All @@ -32,13 +33,14 @@ import '../style/index.css';
/**
* Initialization data for the jupyterlab-toc extension.
*/
const extension: JupyterLabPlugin<ITableOfContentsRegistry> = {
const extension: JupyterFrontEndPlugin<ITableOfContentsRegistry> = {
id: 'jupyterlab-toc',
autoStart: true,
provides: ITableOfContentsRegistry,
requires: [
IDocumentManager,
IEditorTracker,
ILabShell,
ILayoutRestorer,
IMimeDocumentTracker,
INotebookTracker,
Expand All @@ -51,9 +53,10 @@ const extension: JupyterLabPlugin<ITableOfContentsRegistry> = {
* Activate the ToC extension.
*/
function activateTOC(
app: JupyterLab,
app: JupyterFrontEnd,
docmanager: IDocumentManager,
editorTracker: IEditorTracker,
labShell: ILabShell,
restorer: ILayoutRestorer,
mimeDocumentTracker: IMimeDocumentTracker,
notebookTracker: INotebookTracker,
Expand All @@ -69,7 +72,7 @@ function activateTOC(
toc.title.iconClass = 'jp-TableOfContents-icon jp-SideBar-tabIcon';
toc.title.caption = 'Table of Contents';
toc.id = 'table-of-contents';
app.shell.addToLeftArea(toc, { rank: 700 });
labShell.add(toc, 'left', { rank: 700 });

// Add the ToC widget to the application restorer.
restorer.add(toc, 'juputerlab-toc');
Expand Down Expand Up @@ -103,7 +106,7 @@ function activateTOC(
registry.addGenerator(latexGenerator);

// Change the ToC when the active widget changes.
app.shell.currentChanged.connect(() => {
labShell.currentChanged.connect(() => {
let widget = app.shell.currentWidget;
if (!widget) {
return;
Expand Down
Loading

0 comments on commit f34950c

Please sign in to comment.