How to export current notebook in HTML on Jupyter

后端 未结 3 1653
渐次进展
渐次进展 2021-02-04 02:03

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

3条回答
  •  你的背包
    2021-02-04 02:24

    You can do it. Use the following very simple steps:

    I am using: OS: Ubuntu, Anaconda-Jupyter notebook, Python 3

    1 Save your Notebook in HTML format:

    1. Start the jupyter notebook that you want to save in HTML format. First save the notebook properly so that HTML file will have a latest saved version of your code/notebook.

    2. Run the following command from the notebook itself:

      !jupyter nbconvert --to html your_notebook_name.ipynb

    Edit: or you can also use: !jupyter nbconvert your_notebook_name.ipynb --to html

    After execution will create HTML version of your notebook and will save it in the current working directory. You will see one html file will be added into the current directory with your_notebook_name.html name

    (your_notebook_name.ipynb --> your_notebook_name.html).

    If you want to know how to save it into pdf format please check my answer on this question as well: IPython notebook - unable to export to pdf

提交回复
热议问题