Closed bollwyvl closed 8 months ago
Having a launcher type that ran a list of commands would be useful for a number of general cases.
This would harmonize with other systems like jupyterlab_commands, and possibly replace (or become the implementation for) a few of the existing items.
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.
await execute(id, args)
Commands that return interesting values might be a bit hard, but could potentially be named and reused.
Thanks @bollwyvl for the suggestion. I will add it to the next release.
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.
notebook-voila
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:
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.