I have been working on building a custom sidebar, and I found out this code snippet (below) on creating a simple sidebar. Please help me understand why it doesn't work and if it needs any fixes.
I am facing an error while the code compiles, where it could not find some of the 'node_modules'.
I am trying to get a basic UI and then keep adding features as I build them out. Thanks!
/**
* Activate the extension.
*/
function activateext(
app: JupyterLab,
docmanager: IDocumentManager,
editorTracker: IEditorTracker,
restorer: ILayoutRestorer,
notebookTracker: INotebookTracker,
rendermime: IRenderMimeRegistry,
palette: ICommandPalette,
): IExt {
// Create the ext widget.
const ext = new Ext({docmanager, rendermime, palette});
// Create the ext registry.
const registry = new ExtRegistry();
//add commands
addCommands(app, palette);
// Add the ext to the left area.
ext.title.label = 'DTLA';
ext.id = 'table-of-contents';
app.shell.addToLeftArea(ext, {rank: 700});
// Add the ext widget to the application restorer.
restorer.add(ext, 'juputerlab-ext');
return registry;
}
export default extension;
I found this code snippet at JupyterLab - add a subset of commands to sidebar tab