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].
Jupyter notebooks are popular in the data science / Python communities to explain concepts, for examples see here [2].
[0] https://jupyter.org/
[1] https://ipython.org/ipython-doc/3/notebook/nbformat.html
[2] https://github.com/jupyter/jupyter/wiki/A-gallery-of-interes...