Clone nbconvert if we don't have it already
import os
if os.path.exists('nbconvert'):
print "already have nbconvert"
else:
print "cloning nbconvert..."
!git clone --quiet git://github.com/ipython/nbconvert
already have nbconvert
And do a simple plot, to show that figures work:
%pylab inline
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline]. For more information, type 'help(pylab)'.
x = linspace(-1,1)
plot(sin(10*x),x)
plot(x,sin(10*x))
[<matplotlib.lines.Line2D at 0x104a81650>]
Trigger save via Javascript (this is totally unnecessary, but useful for 'run all')
from IPython.display import display, Javascript
display(Javascript("IPython.notebook.save_notebook()"))
And run nbconvert to generate the HTML notebook
!python nbconvert/nbconvert.py -f html "staticHTML.ipynb"
And here is a link to the static HTML render of this notebook