How export a Jupyter notebook to HTML from the command line?

后端 未结 3 811
天涯浪人
天涯浪人 2021-02-01 07:52

I\'m writing test visualization program based on test results. I want to run jupyter notebook via terminal and generate html page to show it to user without showing the editabl

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-01 08:09

    Yes you can and it's quite easy and a built in feature

    jupyter nbconvert --to html notebook.ipynb
    

    That will generate a notebook.html file. Output can be customized. Also check out the slideshow functionality (View>Cell-Toolbar>Slideshow) which can also be used with nbconvert.

    Also the notebook.ipynb Jupyter file can be uploaded to Github where the current version gets rendered. Depending on what you want that information might be useful too

    Also check out line/cell magic. You can run bash commands directly in your jupyter cell like so:

    %%bash
    convert graphviz/MyPic.jpg -resize 70% graphviz/MyPic_sm.jpg
    

提交回复
热议问题