How to output both notebook with output cell and HTML without running twice?

From one notebook, I want to execute the notebook, write output to notebook, and also output HTML.

My currently approach is run 2 command line.

jupyter nbconvert SimpleNotebook.ipynb --to notebook --execute 
jupyter nbconvert SimpleNotebook.ipynb --to html --execute --no-input

The problem is that the notebook run twice. I can see that from output on terminal.

[NbConvertApp] Converting notebook SimpleNotebook.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: python3
[NbConvertApp] Writing 18547 bytes to SimpleNotebook.nbconvert.ipynb
[NbConvertApp] Converting notebook SimpleNotebook.ipynb to html
[NbConvertApp] Executing notebook with kernel: python3
[NbConvertApp] Writing 280188 bytes to SimpleNotebook.html

Each run take a considerble amount of time.

I want to run only once and output both format. How can I do that with command line ?.

I asked question on stackoverflow, but did not get answer yet.

Did you try leaving out the --execute in your second command and make sure to use the output of the first command as the input for the second?

The following would replace your two commands using your example:

jupyter nbconvert SimpleNotebook.ipynb --to notebook --execute 
jupyter nbconvert SimpleNotebook.nbconvert.ipynb --to html --no-input