Skip to content

Commit 3d1f5b9

Browse files
committed
Add the table of content dependency
1 parent c63f983 commit 3d1f5b9

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

app/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ async function main() {
145145
require('@jupyterlab/terminal-extension'),
146146
require('@jupyterlab/theme-light-extension'),
147147
require('@jupyterlab/theme-dark-extension'),
148+
require('@jupyterlab/toc-extension').default.filter(({ id }) =>
149+
[
150+
'@jupyterlab/toc-extension:registry',
151+
'@jupyterlab/toc-extension:tracker'
152+
].includes(id)
153+
),
148154
require('@jupyterlab/translation-extension'),
149155
// Add the "Hub Control Panel" menu option when running in JupyterHub
150156
require('@jupyterlab/user-extension'),

app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
"@jupyterlab/terminal-extension": "^4.0.0-alpha.10",
134134
"@jupyterlab/theme-dark-extension": "^4.0.0-alpha.10",
135135
"@jupyterlab/theme-light-extension": "^4.0.0-alpha.10",
136+
"@jupyterlab/toc-extension": "^6.0.0-alpha.10",
136137
"@jupyterlab/tooltip-extension": "^4.0.0-alpha.10",
137138
"@jupyterlab/translation-extension": "^4.0.0-alpha.10",
138139
"@jupyterlab/user-extension": "^4.0.0-alpha.10",

packages/application/src/shell.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
7575
} else {
7676
this.layout = this.initLayoutWithoutSidePanels();
7777
}
78+
7879
}
7980

8081
initLayoutWithoutSidePanels(): Layout {
@@ -263,14 +264,14 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
263264
if (this.sidePanelsVisible()) {
264265
return this._leftHandler.addWidget(widget, rank);
265266
}
266-
throw new Error(`${area} area is not available on this page`);
267+
console.warn(`${area} area is not available on this page`);
267268
case 'right':
268269
if (this.sidePanelsVisible()) {
269270
return this._rightHandler.addWidget(widget, rank);
270271
}
271-
throw new Error(`${area} area is not available on this page`);
272+
console.warn(`${area} area is not available on this page`);
272273
default:
273-
throw new Error(`Cannot add widget to area: ${area}`);
274+
console.warn(`Cannot add widget to area: ${area}`);
274275
}
275276
}
276277

0 commit comments

Comments
 (0)