{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# NbConvert, Python library" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this Notebook, I will introduce you to the programatic API of nbconvert to show you how to use it in various context. \n", "\n", "For this I will use one of [@jakevdp](https://github.com/jakevdp) great [blog post](http://jakevdp.github.io/blog/2013/04/15/code-golf-in-python-sudoku/).\n", "I've explicitely chosen a post with no javascript tricks as Jake seem to be found of right now, for the reason that the becommings of embeding javascript in nbviewer, which is based on nbconvert is not fully decided yet. \n", "\n", "\n", "This will not focus on using the command line tool to convert file. The attentive reader will point-out that no data are read from, or written to disk during the conversion process. Indeed, nbconvert as been though as much as\n", "possible to avoid IO operation and work as well in a database, or web-based environement." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Quick overview" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
Warning, Do use 1.0 or 1.x branch and not master naming have changed.\n", "\n", "
Warning, NbConvert is a Tech-Preview, API will change within the next 6 month." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Credit, Jonathan Freder (@jdfreder on github)\n", "\n", "
This notebook originally appeared as a blog post at `_\n",
"by Jake Vanderplas.\n",
"\n",
" *Update: the matplotlib pull request has been merged! See* `*This\n",
"post* This post was written entirely in an IPython Notebook: the notebook file is available for download here. For more information on blogging with notebooks in octopress, see my previous post on the subject. As @Mbussonn requested... easieeeeer! Deploy your Nikola site with just a click in the IPython notebook! http://t.co/860sJunZvj cc @ralsinafrom'"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"i = body.index('highlight-ipynb')\n",
"body[i-12:i+50]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Programatically make templates"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"
\n",
"