-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
Description
Lumino 2 now supports adding a description to plugins: jupyterlab/lumino#572
Currently most plugins in this repo don't make use of it, for example:
notebook/packages/application-extension/src/index.ts
Lines 499 to 533 in b5133c6
| /** | |
| * A plugin to display the document title in the browser tab title | |
| */ | |
| const tabTitle: JupyterFrontEndPlugin<void> = { | |
| id: '@jupyter-notebook/application-extension:tab-title', | |
| autoStart: true, | |
| requires: [INotebookShell], | |
| activate: (app: JupyterFrontEnd, shell: INotebookShell) => { | |
| const setTabTitle = () => { | |
| const current = shell.currentWidget; | |
| if (current instanceof ConsolePanel) { | |
| const update = () => { | |
| const title = | |
| current.sessionContext.path || current.sessionContext.name; | |
| const basename = PathExt.basename(title); | |
| // Strip the ".ipynb" suffix from filenames for display in tab titles. | |
| document.title = basename.replace(STRIP_IPYNB, ''); | |
| }; | |
| current.sessionContext.sessionChanged.connect(update); | |
| update(); | |
| return; | |
| } else if (current instanceof DocumentWidget) { | |
| const update = () => { | |
| const basename = PathExt.basename(current.context.path); | |
| document.title = basename.replace(STRIP_IPYNB, ''); | |
| }; | |
| current.context.pathChanged.connect(update); | |
| update(); | |
| } | |
| }; | |
| shell.currentChanged.connect(setTabTitle); | |
| setTabTitle(); | |
| }, | |
| }; |
We should add them to the notebook code base, so it's useful for contributors but also for users at some point: jupyterlab/jupyterlab#14536