What the author wrote is a IPython / Jupyter notebook [0], which is implemented as a JSON document [1]. The notebooks are pretty much markdown with runnable code blocks in between.
Jupyter notebooks are popular in the data science / Python communities to explain concepts, for examples see here [2].