How to call three commands with one button?

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.

Thanks.

Hi @LMX ,

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:

All the best,
Jason Weill

1 Like

Thanks for the response. But I have a pathological aversion to nodejs. :mask: