Skip to content

Add a description to plugins #7008

Closed
@jtpio

Description

@jtpio

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:

/**
* 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions