Jupyter notebooks with Quarto
Jupyter notebooks can be rendered with Quarto.
In a first step, I create a simple notebook with the code from the Quarto documentation on Jupyter Lab. Secondly, I copied the notebook and added a Quarto header in a Raw first cell. Finally, I converted the original notebook into a Quarto document with quarto convert
.
I rendered all versions of the Jupyter notebook with Quarto and here are the results:
I also learned that you have to pass an option when rendering ipynb-files – quarto render notebook.ipynb --execute
. The assumption is that a notebook was already run and that the results shall be rendered.
This all worked well for me and it solved a major issue I had with Jupyter notebooks. With R Markdown I really liked that you could convert a notebook into static HTML. To my knowledge, this was not possible with Jupyter notebooks. They could be exported to HTML in Jupyter Lab but not rendered into HTML.