Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export current notebook in HTML on Jupyter

How can I export the current notebook (from inside the notebook itself, using Python) to HTML (to a custom output path)?

like image 901
fabiopedrosa Avatar asked Mar 09 '16 16:03

fabiopedrosa


People also ask

How do I export a Jupyter Notebook to HTML?

Jupyter Notebook's Built-In Capability: If including code, this is the easiest way to create the JNaaP. This method is as simple as clicking File, Download as, HTML (. html). Jupyter will then download the notebook as an HTML file to wherever the browser defaults for downloaded files.

How do I export my Jupyter Notebook?

The Jupyter Notebook has an option to export the notebook to many formats. It can be accessed by clicking File -> Download as -> PDF via LaTeX (or PDF via HTML - not visible in the screenshot). This approach requires you to install some additional packages.

How do I export and share a notebook in Jupyter?

You can export to a variety of formats from within the notebook by navigating to File -> Download As. You'll want to export your notebook as a Jupyter Interactive Notebook ( . ipynb file format) if you'd like the person you're sharing it with to interact with the notebook.


1 Answers

By looking at nbconvert docs, you'll see that you can use --to html method:

import os  os.system('jupyter nbconvert --to html yourNotebook.ipynb') 

This will create a yourNotebook.html file inside yourNotebook.ipynb folder.

like image 197
dot.Py Avatar answered Oct 07 '22 17:10

dot.Py