nbformat 4 nbformat_minor 2 markdown This notebook is part of the `jupyter_format` documentation: https://jupyter-format.readthedocs.io/. cell_metadata { "nbsphinx": "hidden" } markdown # Notebook format conversions with `nbconvert` During the installation of `jupyter_format` (see [Installation](installation.jupyter)), so-called "entry points" for `nbconvert` are configured automatically. You can convert `.ipynb` notebooks to `.jupyter` notebooks with python3 -m nbconvert --to jupyter my-old-notebook.ipynb To convert a `.jupyter` notebook to any format supported by `nbconvert`, just append `-from-jupyter` to the desired format. For example, you can convert a `.jupyter` notebook to the traditional `.ipynb` format: python3 -m nbconvert --to ipynb-from-jupyter my-new-notebook.jupyter Or you can convert a `.jupyter` file to an HTML file: python3 -m nbconvert --to html-from-jupyter my-new-notebook.jupyter Same for `slides-from-jupyter`, `latex-from-jupyter`, `pdf-from-jupyter` etc. markdown But enough for the theory, let's try it with this very notebook, shall we? code !python3 -m nbconvert --to ipynb-from-jupyter nbconvert.jupyter --output=my-new-notebook markdown Just to make sure it is actually using Jupyter's JSON format, let's peek at the beginning of the file: code !head my-new-notebook.ipynb markdown Here's a link to the new file for your perusal: [my-new-notebook.ipynb](my-new-notebook.ipynb). Now let's convert this back to `.jupyter`: code !python3 -m nbconvert --to jupyter my-new-notebook.ipynb markdown Again, we take a peek: code !head my-new-notebook.jupyter markdown And a link for closer inspection: [my-new-notebook.jupyter](my-new-notebook.jupyter). Finally, let's try to convert this `.jupyter` file to an HTML page: code !python3 -m nbconvert --to html-from-jupyter my-new-notebook.jupyter code from IPython.display import IFrame IFrame('my-new-notebook.html', width='100%', height=350) markdown And for completeness' sake, a link: [my-new-notebook.html](my-new-notebook.html). notebook_metadata { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.2+" } }