I would like to export a JupyterLab notebook (not Jupyter Notebook) to HTML.
I am using the following code inside of the notebook itself, that correctly exports the notebook:
os.popen('jupyter nbconvert current_notebook.ipynb --to html').read()
However, nbconvert is not getting current notebook but the last saved state, on disk, of the notebook.
So, I need to save the state before trying to export it.
I am trying to use the following code:
%%javascript
IPython.notebook.save_notebook()
But apparently JupyterLab does not support JS API, so it is returning the following message:
Javascript Error: IPython is not defined
Do you know a way to save the current state of the notebook before exporting it?