Setup nbconvert

From HPCWIKI
Revision as of 10:13, 21 December 2023 by Admin (talk | contribs) (Created page with "== nbconvert == The '''nbconvert''' tool<ref>https://github.com/jupyter/nbconvert</ref> (jupyter nbconvert) converts notebooks to various other formats via Jinja templates. The nbconvert tool allows you to convert an .ipynb into * HTML * LaTeX * PDF * Reveal JS * Markdown (md) * ReStructured Text (rst) * executable script * etc == Setup nvconvert on Ubuntu == <syntaxhighlight lang="bash"> #Install pandoc sudo apt-get install pandoc # install nbconvert with webpdf su...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

nbconvert

The nbconvert tool[1] (jupyter nbconvert) converts notebooks to various other formats via Jinja templates. The nbconvert tool allows you to convert an .ipynb into

  • HTML
  • LaTeX
  • PDF
  • Reveal JS
  • Markdown (md)
  • ReStructured Text (rst)
  • executable script
  • etc

Setup nvconvert on Ubuntu

#Install pandoc 
sudo apt-get install pandoc

# install nbconvert with webpdf
sudo -H pip install --upgrade nbconvert[webpdf] pyppeteer

#Running the tests after a dev install above:
pip install nbconvert[test]
py.test --pyargs nbconvert

Usage

General command line usage is, $ jupyter nbconvert --to <output format> <input notebook>

#allow notebook to export webpdf format
jupyter nbconvert --to webpdf --allow-chromium-download HPCMATE.ipynb


Further details is available at https://nbconvert.readthedocs.io/en/latest/usage.html

References