May 13, 2023, 1:26pm
Hi, I have three buttons in a markdown cell performing three command tasks (START, STOP, CLEAR):
<button data-commandLinker-command="notebook:run-all-below" href="#">START</button>
<button data-commandLinker-command="kernelmenu:interrupt" href="#">STOP</button>
<button data-commandLinker-command="notebook:clear-all-cell-outputs" href="#">CLEAR</button>
I wanted to know if it is possible, perhaps using JS, to have one “START/RESTART” button that performs these three commands in order of STOP+CLEAR+START. Or at least a STOP+CLEAR in one button.
In this situation, I would create an extension defining a semantic command with these three commands in it, then add a button that calls that new semantic command. You can see an example of a two-command semantic command here:
label: trans.__('Restart Kernel and Clear…')
All the best,
May 17, 2023, 4:28pm
Thanks for the response. But I have a pathological aversion to nodejs.