Lab Extension: Open Notebook in New Tab, from MainAreaWidget

I have an extension which contains a MainAreaWidget with HTML+JavaScript. Is it possible to have a clickable button or link that, when clicked, causes a Notebook to be opened in a new tab?

It looks like you can create a NotebookPanel, and then add it to the current “view” using IShell which is part of JupyterFrontEnd . Interested in whether this is the recommended way to do it?

@ew23 there is also the docmanager:open command that can be used to open notebook files in the main area:

commands.execute('docmanager:open', {
  path: 'example.ipynb',
  options: {
	mode: 'split-right'
  }
});