0

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

1 Answers1

0

I also need to add customized side-bar to the jupyter-lab (TAT). I also meet a lot of node-modules not found errors, and I found that there are many modules of @jupyterLab/ not in the node_modules folder of the project I created with cookiecutter, even though these module can be found in jupyterLab.So my solution is to find those missing modules on npm and install them to the project.

Adriaan
  • 17,741
  • 7
  • 42
  • 75
simon
  • 21
  • 3