trungleduc / jupyter_app_launcher

A JupyterLab extension to create custom launcher entries.
https://jupyter-app-launcher.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
53 stars 11 forks source link

Add a `jupyterlab-commands` launcher type #19

Closed bollwyvl closed 8 months ago

bollwyvl commented 1 year ago

Elevator Pitch

Having a launcher type that ran a list of commands would be useful for a number of general cases.

Motivation

This would harmonize with other systems like jupyterlab_commands, and possibly replace (or become the implementation for) a few of the existing items.

Design Ideas

Update the schema to allow things like:

- type: jupyterlab-commands
  commands: 
   - label: Open Notebook
     id: filebrowser:open:
     args: 
       path: SomeNotebook.ipynb
   - label: Run all cells
     id: runmenu:restart-and-run-all
   - label: Save
     id: docmanager:save
   - label: Export
     id: notebook:export-to-format
     args: 
       format: html
   - label: Open HTML
     id: filebrowser:open:
     args:
       path: SomeNotebook.html

On the implementation side, it should just be able to await execute(id, args) each in turn. If one failed, it could report what stage failed.

Commands that return interesting values might be a bit hard, but could potentially be named and reused.

trungleduc commented 1 year ago

Thanks @bollwyvl for the suggestion. I will add it to the next release.

ZS-Gao commented 10 months ago

I have a similar use case for the notebook-voila type that I'd like run a script before the notebook is rendered with voila.