Create a new launcher that will have some sample notebooks tiles

jupyterlab-starters (disclaimer: author) is an extension that, at its simplest, will copy files (such as notebook) to the current working directory and open it, but can be expanded to do cookiecutter-like things (though the cookiecutter integration proper is kinda busted with the newest version). This might be overkill for what you need… but you also wouldn’t have to write it.

In its simplest form, you’d need to:

  • get an extension, perhaps with the cookiecutter-cookiecutter-ts or one of the examples
  • make a function
    • use app.commands.execute('notebook:new-untitled', {}) to create the notebook
    • use the resulting panel object to access the document model
    • change the model to what you want it to be
      • you can use await import('!raw-loader!!example.ipynb') to lazy load a static file
  • call that function from a command
  • use that command in a launcher panel

See also: External API calls to trigger JupyterLab features - #7 by bollwyvl

1 Like