Hello, World!

This is a test of using Jekyll and Jupyter together to make a blog. We'll set the title by adding a bit of metadata to the Notebook (this can be changed from Edit → Edit Notebook Metadata):

"jekyll": {
    "name": "Hello, World!"
  }

We can plot things in blog posts in the usual way, with the familiar Jupyter Notebook commands.

In [1]:
%matplotlib inline
In [2]:
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot-rq')
In [3]:
xs = np.linspace(0, 10, 201)
plt.plot(xs, np.cos(xs))
Out[3]:
[<matplotlib.lines.Line2D at 0x6c54ba8>]

Once we're done, we can use nbconvert to turn everything into a Jekyll-ready HTML page.

In [4]:
!jupyter nbconvert --to html --template jekyll.tpl 2016-05-27-hello-world.ipynb
[NbConvertApp] Converting notebook 2016-05-27-hello-world.ipynb to html
[NbConvertApp] Writing 22044 bytes to 2016-05-27-hello-world.html

This should be fun!