Skip to content

Commit 086b95f

Browse files
committed
adding test title
1 parent 676a0fe commit 086b95f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/notebook-extension/src/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,4 +605,24 @@ const plugins: JupyterFrontEndPlugin<any>[] = [
605605
trusted,
606606
];
607607

608+
/**
609+
* A plugin to add a "test" title at the top of the notebook.
610+
*/
611+
const addTestTitle: JupyterFrontEndPlugin<void> = {
612+
id: '@jupyter-notebook/notebook-extension:add-test-title',
613+
description: 'A plugin to add a "test" title at the top of the notebook.',
614+
autoStart: true,
615+
requires: [INotebookShell],
616+
activate: (app: JupyterFrontEnd, shell: INotebookShell) => {
617+
const titleWidget = new Widget({ node: document.createElement('h1') });
618+
titleWidget.node.textContent = 'Test';
619+
titleWidget.addClass('jp-NotebookTest-title');
620+
621+
app.shell.add(titleWidget, 'top', { rank: 0 });
622+
}
623+
};
624+
625+
// Add this to the plugins array
626+
plugins.push(addTestTitle);
627+
608628
export default plugins;

0 commit comments

Comments
 (0)