Skip to content

Commit

Permalink
Add the table of content dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Aug 2, 2022
1 parent c63f983 commit 3d1f5b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ async function main() {
require('@jupyterlab/terminal-extension'),
require('@jupyterlab/theme-light-extension'),
require('@jupyterlab/theme-dark-extension'),
require('@jupyterlab/toc-extension').default.filter(({ id }) =>
[
'@jupyterlab/toc-extension:registry',
'@jupyterlab/toc-extension:tracker'
].includes(id)
),
require('@jupyterlab/translation-extension'),
// Add the "Hub Control Panel" menu option when running in JupyterHub
require('@jupyterlab/user-extension'),
Expand Down
1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"@jupyterlab/terminal-extension": "^4.0.0-alpha.10",
"@jupyterlab/theme-dark-extension": "^4.0.0-alpha.10",
"@jupyterlab/theme-light-extension": "^4.0.0-alpha.10",
"@jupyterlab/toc-extension": "^6.0.0-alpha.10",
"@jupyterlab/tooltip-extension": "^4.0.0-alpha.10",
"@jupyterlab/translation-extension": "^4.0.0-alpha.10",
"@jupyterlab/user-extension": "^4.0.0-alpha.10",
Expand Down
7 changes: 4 additions & 3 deletions packages/application/src/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
} else {
this.layout = this.initLayoutWithoutSidePanels();
}

}

initLayoutWithoutSidePanels(): Layout {
Expand Down Expand Up @@ -263,14 +264,14 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
if (this.sidePanelsVisible()) {
return this._leftHandler.addWidget(widget, rank);
}
throw new Error(`${area} area is not available on this page`);
console.warn(`${area} area is not available on this page`);
case 'right':
if (this.sidePanelsVisible()) {
return this._rightHandler.addWidget(widget, rank);
}
throw new Error(`${area} area is not available on this page`);
console.warn(`${area} area is not available on this page`);
default:
throw new Error(`Cannot add widget to area: ${area}`);
console.warn(`Cannot add widget to area: ${area}`);
}
}

Expand Down

0 comments on commit 3d1f5b9

Please sign in to comment.