Embed a Jupyter Notebook on this Blog
2014 August 4
Warning: these instructions are old and need revision.
- Write up the notebook. Make sure to keep lines short since there isn’t much horizontal room in the blog format.
- Run:
ipython nbconvert --to html notebook.ipynb
- Copy the output file to a name like
notebook-title.html
. - Add tweaks at the end of the CSS, just before the “Custom stylesheet” comment:
Font matching is difficult because you can’t bridge CSS et al in iframes, and the outer level has its own magic setup.img { max-width: 560px !important: } /* TO BE CONFIRMED */ .prompt { display: none; } body { padding: 0; } div.text_cell_render { padding: 0; }
- Use Zola’s colocated assets to include the notebook HTML, and embed a link emulating this example.