Create a new launcher that will have some sample notebooks tiles

Hi Team,

We have a requirement in which we want to create a new launcher that will have some notebook tiles and if we click on the tile(sample hello world notebook), the respective notebook should open.

Existing default launcher will be there, but we wanted to have a new launcher also that will take care opening or view sample notebooks.

Can you please help us? Do we have any such example that can help us to create a new launcher as per requirement.?

We have mock screen below, something like we want to have launcher.

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

HI @bollwyvl

Thanks for reply…!!

We are already having some sample notebooks. We want to open those notebooks through new launcher that would be having all notebook tiles let say there is Hello World tile. and if click on that it will open already exist hello-world.ipnyb notebook file so that User can make some changes or view notebook.

we have a mock screen below, something like we want to achieve.

For that to actually quack like the launcher (e.g. be launched by the file browser), you’d have to replace the launcher entirely.

If you don’t care about integration, and control the deployment, you could achieve that with a custom workspace that opens a rendered markdown file pointing to those, or a very simple extension that is just renders some markdown (potentiallly by injecting it into the launcher Widget… though this is ugly).

1 Like

Hi @bollwyvl , @jtp

Thank you for response…!!

Actually we want to have two launcher at the same time.
one is default and second is custom that we want to implement.
User can switch to any of them at any time. That’s the requirement we have.

As you can see in attached snapshot there are two launcher(default and custom).
Please help us here.

Thanks in advance…!!

Welp, we aren’t going to be able to write your extension for you on this forum. If it’s just content and a workspace, you won’t need an extension.

If you do need an extension, the list of stuff mentioned previously still holds as the course you’ll probably need to take, with an emphasis on reading the examples repo, and firing up a live jlpm watch and trying stuff out interactively.