I'm wondering if it's possible to export a Jupyter notebook to a different directory than the same directory as the notebook itself? I'm using this to build HTML versions of the notebooks, and I'd like them to reside under docs/
in my GitHub repo (this is to take advantage of GH-pages).
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.
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.
Create a notebook and the click "File -> Download As". Click the new menu entry called "PDF via HTML". Your notebook will be converted to a PDF on the fly and then downloaded.
NBConvert's --output-dir argument does this: https://nbconvert.readthedocs.io/en/latest/install.html
You can use it from the command line or from within a Jupyter notebook.
Command line:
jupyter nbconvert --output-dir='./docs' --to html my_notebook_to_be_converted.ipynb
From within a Jupyter Notebook cell:
!jupyter nbconvert --output-dir='./docs' --to html my_notebook_to_be_converted.ipynb
Note that you don't need to use "--to html" to convert a notebook to html because the default output format is html. I've included the argument solely for clarity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With