{ "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", "
\n", " ![nbca](files/nbconvert_arch.png)\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The main principle of nbconvert is to instanciate a `Exporter` that controle\n", "a pipeline through which each notebook you want to export with go through." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's start by importing what we need from the API, and download @jakevdp's notebook." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "'{\\n \"metadata\": {\\n \"name\": \"XKCD_plots\"\\n },\\n \"nbformat\": 3,\\n...'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import requests\n", "response = requests.get('http://jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb')\n", "response.content[0:60]+'...'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you do not have request install downlad by hand, and read the file as usual." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We read the response into a slightly more convenient format which represent IPython notebook. \n", "There are not real advantages for now, except some convenient methods, but with time this structure should be able to\n", "guarantee that the notebook structure is valid. Note also that the in-memory format and on disk format can be slightly different. In particual, on disk, multiline strings might be spitted into list of string to be more version control friendly." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "{u'cell_type': u'heading',\n", " u'level': 1,\n", " u'metadata': {},\n", " u'source': u'XKCD plots in Matplotlib'}" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.nbformat import current as nbformat\n", "jake_notebook = nbformat.reads_json(response.content)\n", "jake_notebook.worksheets[0].cells[0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So we have here Jake's notebook in a convenient form, which is mainly a Super-Powered dict and list nested.\n", "You don't need to worry about the exact structure." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The nbconvert API exposes some basic exporter for common format and default options. We will start\n", "by using one of them. First we import it, instanciate an instance with most of the default parameters and fed it\n", "the downloaded notebook. " ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import IPython.nbconvert" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from IPython.config import Config\n", "from IPython.nbconvert import HTMLExporter\n", "\n", "## I use `basic` here to have less boilerplate and headers in the HTML.\n", "## we'll see later how to pass config to exporters.\n", "exportHtml = HTMLExporter(config=Config({'HTMLExporter':{'default_template':'basic'}}))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [], "source": [ "(body, resources) = exportHtml.from_notebook_node(jake_notebook)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The exporter returns a tuple containing the body of the converted notebook, here raw HTML, as well as a resources dict.\n", "The resource dict contains (among many things) the extracted PNG, JPG [...etc] from the notebook when applicable.\n", "The basic HTML exporter does keep them as embeded base64 into the notebook, but one can do ask the figures to be extracted. Cf advance use. So for now the resource dict **should** be mostly empty, except for 1 key containing some css, and 2 others whose content will be obvious.\n", "\n", "Exporter are stateless, you won't be able to extract any usefull information (except their configuration) from them.\n", "You can directly re-use the instance to convert another notebook. Each exporter expose for convenience a `from_file` and `from_filename` methods if you need." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['inlining', 'output_extension', 'metadata']\n", "defaultdict(None, {'name': 'Notebook'})\n", "html\n" ] } ], "source": [ "print resources.keys()\n", "print resources['metadata']\n", "print resources['output_extension']\n", "# print resources['inlining'] # too lng to be shown" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "
\n", "

XKCD plots in Matplotlib

\n", "
\n", "\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* `_\n", "*for a description of the XKCD functionality now built-in to\n", "matplotlib!*\n", "\n", "One of the problems I've had with typical matplotlib figures is that\n", "everything in them is so precise, so perfect. For an example of what I\n", "mean, take a look at this figure:\n", "In[1]:\n", ".. code:: python\n", "\n", " from IPython.display import Image\n", " Image('http://jakevdp.github.com/figures/xkcd_version.png')\n", "\n", "\n", "\n", "\n", "\n", ".. image:: output_3_0.png\n", "\n", "\n", "\n", "Sometimes when showing schematic plots, this is the type of figure I\n", "want to display. But drawing it by hand is a pain: I'd rather just use\n", "matplotlib. The problem is, matplotlib is a bit...\n", "[.....]\n", "owing schematic plots, this is the type of figure I\n", "want to display. But drawing it by hand is a pain: I'd rather just use\n", "matplotlib. The problem is, matplotlib is a bit too precise. Attempting\n", "to duplicate this figure in matplotlib leads to something like this:\n", "In[2]:\n", ".. code:: python\n", "\n", " Image('http://jakevdp.github.com/figures/mpl_version.png')\n", "\n", "\n", "\n", "\n", "\n", ".. image:: output_5_0.png\n", "\n", "\n", "\n", "It just doesn'...\n" ] } ], "source": [ "print body[:970]+'...'\n", "print '[.....]'\n", "print body[800:1200]+'...'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we see that base64 images are not embeded, but we get what look like file name. Actually those are (Configurable) keys to get back the binary data from the resources dict we havent inspected earlier.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So when writing a Rst Plugin for any blogengine, Sphinx or anything else, you will be responsible for writing all those data to disk, in the right place. \n", "Of course to help you in this task all those naming are configurable in the right place." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "let's try to see how to get one of these images" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[u'output_13_1.text',\n", " u'output_18_0.text',\n", " u'output_3_0.text',\n", " u'output_18_1.png',\n", " u'output_12_0.text',\n", " u'output_5_0.text',\n", " u'output_5_0.png',\n", " u'output_13_1.png',\n", " u'output_16_0.text',\n", " u'output_13_0.text',\n", " u'output_18_1.text',\n", " u'output_3_0.png',\n", " u'output_16_0.png']" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "resources['outputs'].keys()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We have extracted 5 binary figures, here `png`s, but they could have been svg, and then wouldn't appear in the binary sub dict.\n", "keep in mind that a object having multiple _repr_ will store all it's repr in the notebook. \n", "\n", "Hence if you provide `_repr_javascript_`,`_repr_latex_` and `_repr_png_`to an object, you will be able to determine at conversion time which representaition is the more appropriate. You could even decide to show all the representaition of an object, it's up to you. But this will require beeing a little more involve and write a few line of Jinja template. This will probably be the subject of another tutorial.\n", "\n", "Back to our images,\n", "\n" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbAAAAEgCAYAAADVKCZpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs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jn++usvtc0RCBo8iYmJRsEZNjY2FBoaSnl5eWqbViPdu3eX7ZYkiXQ6HZ07d05t\ns2rk5MmTpNFo6PPPPyciotOnT9cq5L8+YETiVK1S0ENLHQKB4OnIy8tDZGQkAgIC0K9fP7XNeSw2\nb96M3NxcvP3222qb0mARAiYQCASCBokIoxcIBAJBg0QImEAgEAgaJELABAKBQNAgEQImEAgEggaJ\nEDCBQCAQNEiEgAkEAoGgQSIETCAQCAQNEiFgAoFAIGiQCAETCAQCQYPk/wEPvRJNIO9OCwAAAABJ\nRU5ErkJggg==\n", "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import Image\n", "Image(data=resources['outputs']['output_3_0.png'],format='png')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Yep, this is indeed the image we were expecting, and I was able to see it without ever writing or reading it from disk. I don't think I'll have to show to you what to do with those data, as if you are here you are most probably familiar with IO." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Extracting figures with HTML Exporter ?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use case:\n", "\n", "> I write an [awesome blog](http://jakevdp.github.io/) in HTML, and I want all but having base64 embeded images. \n", "Having one html file with all inside is nice to send to coworker, but I definitively want resources to be cached !\n", "So I need an HTML exporter, and I want it to extract the figures !" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Some theory" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The process of converting a notebook to a another format with the nbconvert Exporters happend in a few steps:\n", "\n", " - Get the notebook data and other required files. (you are responsible for that)\n", " - Feed them to the exporter that will\n", " - sequentially feed the data to a number of `Transformers`. Transformer only act on the **structure**\n", " of the notebook, and have access to it all. \n", " - feed the notebook through the jinja templating engine\n", " - the use templates are configurable.\n", " - templates make use of configurable macros called filters.\n", " - The exporter return the converted notebook as well as other relevant resources as a tuple.\n", " - Write what you need to disk, or elsewhere. (You are responsible for it)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we'll be interested in the `Transformers`. Each `Transformer` is applied successively and in order on the notebook before going through the conversion process.\n", "\n", "We provide some transformer that do some modification on the notebook structure by default.\n", "One of them, the `ExtractOutputTransformer` is responsible for crawling notebook,\n", "finding all the figures, and put them into the resources directory, as well as choosing the key\n", "(`filename_xx_y.extension`) that can replace the figure in the template.\n", "\n", "\n", "The `ExtractOutputTransformer` is special in the fact that it **should** be availlable on all `Exporter`s, but is just inactive by default on some exporter." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ,\n", " ]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# second transformer shoudl be Instance of ExtractFigureTransformer\n", "exportHtml._transformers # 3rd one shouel be " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To enable it we will use IPython configuration/Traitlets system. If you are have already set some IPython configuration options, \n", "this will look pretty familiar to you. Configuration option are always of the form:\n", "\n", " ClassName.attribute_name = value\n", " \n", "A few ways exist to create such config, like reading a config file in your profile, but you can also do it programatically usign a dictionary. Let's create such a config object, and see the difference if we pass it to our `HtmlExporter`" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "resources without the \"figures\" key :\n", "['inlining', 'output_extension', 'metadata']\n", "\n", "Here we have one more field \n", "['outputs', 'inlining', 'output_extension', 'metadata']\n" ] }, { "data": { "text/plain": [ "[u'output_13_1.text',\n", " u'output_18_0.text',\n", " u'output_3_0.text',\n", " u'output_18_1.png',\n", " u'output_12_0.text',\n", " u'output_5_0.text',\n", " u'output_5_0.png',\n", " u'output_13_1.png',\n", " u'output_16_0.text',\n", " u'output_13_0.text',\n", " u'output_18_1.text',\n", " u'output_3_0.png',\n", " u'output_16_0.png']" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.config import Config\n", "\n", "c = Config({\n", " 'ExtractOutputTransformer':{'enabled':True}\n", " })\n", "\n", "exportHtml = HTMLExporter()\n", "exportHtml_and_figs = HTMLExporter(config=c)\n", "\n", "(_, resources) = exportHtml.from_notebook_node(jake_notebook)\n", "(_, resources_with_fig) = exportHtml_and_figs.from_notebook_node(jake_notebook)\n", "\n", "print 'resources without the \"figures\" key :'\n", "print resources.keys()\n", "\n", "print ''\n", "print 'Here we have one more field '\n", "print resources_with_fig.keys()\n", "resources_with_fig['outputs'].keys() " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So now you can loop through the dict and write all those figures to disk in the right place... " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Custom transformer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Of course you can imagine many transformation that you would like to apply to a notebook. This is one of the reason we provide a way to register your own transformers that will be applied to the notebook after the default ones.\n", "\n", "To do so you'll have to pass an ordered list of `Transformer`s to the Exporter constructor. \n", "\n", "But what is an transformer ? Transformer can be either *decorated function* for dead-simple `Transformer`s that apply\n", "independently to each cell, for more advance transformation that support configurability You have to inherit from\n", "`Transformer` and define a `call` method as we'll see below.\n", "\n", "All transforers have a magic attribute that allows it to be activated/disactivate from the config dict." ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Four relevant docstring\n", "=============================\n", " A configurable transformer\n", "\n", " Inherit from this class if you wish to have configurability for your\n", " transformer.\n", "\n", " Any configurable traitlets this class exposed will be configurable in profiles\n", " using c.SubClassName.atribute=value\n", "\n", " you can overwrite transform_cell to apply a transformation independently on each cell\n", " or __call__ if you prefer your own logic. See corresponding docstring for informations.\n", "\n", " Disabled by default and can be enabled via the config by\n", " 'c.YourTransformerName.enabled = True'\n", " \n", "=============================\n", "\n", " Transformation to apply on each notebook.\n", " \n", " You should return modified nb, resources.\n", " If you wish to apply your transform on each cell, you might want to \n", " overwrite transform_cell method instead.\n", " \n", " Parameters\n", " ----------\n", " nb : NotebookNode\n", " Notebook being converted\n", " resources : dictionary\n", " Additional resources used in the conversion process. Allows\n", " transformers to pass variables into the Jinja engine.\n", " \n", "=============================\n", "\n", " Overwrite if you want to apply a transformation on each cell. You \n", " should return modified cell and resource dictionary.\n", " \n", " Parameters\n", " ----------\n", " cell : NotebookNode cell\n", " Notebook cell being processed\n", " resources : dictionary\n", " Additional resources used in the conversion process. Allows\n", " transformers to pass variables into the Jinja engine.\n", " index : int\n", " Index of the cell being processed\n", " \n", "=============================\n" ] } ], "source": [ "from IPython.nbconvert.transformers import Transformer\n", "import IPython.config\n", "print \"Four relevant docstring\"\n", "print '============================='\n", "print Transformer.__doc__\n", "print '============================='\n", "print Transformer.call.__doc__\n", "print '============================='\n", "print Transformer.transform_cell.__doc__\n", "print '============================='" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "***\n", "We don't provide convenient method to be aplied on each worksheet as the **data structure** for worksheet will be removed. (not the worksheet functionnality, which is still on it's way)\n", "***" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I'll now demonstrate a specific example [requested](https://github.com/ipython/nbconvert/pull/137#issuecomment-18658235) while nbconvert 2 was beeing developped. The ability to exclude cell from the conversion process based on their index. \n", "\n", "I'll let you imagin how to inject cell, if what you just want is to happend static content at the beginning/end of a notebook, plese refer to templating section, it will be much easier and cleaner." ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from traitlets import Integer" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [], "source": [ "class PelicanSubCell(Transformer):\n", " \"\"\"A Pelican specific transformer to remove somme of the cells of a notebook\"\"\"\n", " \n", " # I could also read the cells from nbc.metadata.pelican is someone wrote a JS extension\n", " # But I'll stay with configurable value. \n", " start = Integer(0, config=True, help=\"first cell of notebook to be converted\")\n", " end = Integer(-1, config=True, help=\"last cell of notebook to be converted\")\n", " \n", " def call(self, nb, resources):\n", "\n", " #nbc = deepcopy(nb)\n", " nbc = nb\n", " # don't print in real transformer !!!\n", " print \"I'll keep only cells from \", self.start, \"to \", self.end, \"\\n\\n\"\n", " for worksheet in nbc.worksheets :\n", " cells = worksheet.cells[:]\n", " worksheet.cells = cells[self.start:self.end] \n", " return nbc, resources" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# I create this on the fly, but this could be loaded from a DB, and config object support merging...\n", "c = Config({\n", " 'PelicanSubCell':{\n", " 'enabled':True,\n", " 'start':4,\n", " 'end':6,\n", " }\n", " })" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I'm creating a pelican exporter that take `PelicanSubCell` extra transformers and a `config` object as parameter. This might seem redundant, but with configuration system you'll see that one can register an inactive transformer on all exporters and activate it at will form its config files and command line. " ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [], "source": [ "pelican = RSTExporter(transformers=[PelicanSubCell], config=c)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "I'll keep only cells from 4 to 6 \n", "\n", "\n", "\n", "Sometimes when showing schematic plots, this is the type of figure I\n", "want to display. But drawing it by hand is a pain: I'd rather just use\n", "matplotlib. The problem is, matplotlib is a bit too precise. Attempting\n", "to duplicate this figure in matplotlib leads to something like this:\n", "In[2]:\n", ".. code:: python\n", "\n", " Image('http://jakevdp.github.com/figures/mpl_version.png')\n", "\n", "\n", "\n", "\n", "\n", ".. image:: output_5_0.png\n", "\n", "\n", "\n" ] } ], "source": [ "print pelican.from_notebook_node(jake_notebook)[0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Programatic example of extending templates / cutom filters" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from IPython.nbconvert.filters.highlight import _pygment_highlight\n", "from pygments.formatters import HtmlFormatter\n", "\n", "from IPython.nbconvert.exporters import HTMLExporter\n", "from IPython.config import Config\n", "\n", "from IPython.nbformat import current as nbformat" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we define a dustom 'highlight' filter that apply a custom class to code in css. We register this filter with a already existing name, so it will replace the default one." ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def my_highlight(source, language='ipython'):\n", " formatter = HtmlFormatter(cssclass='highlight-ipynb')\n", " return _pygment_highlight(source, formatter, language)\n", " \n", "c = Config({'CSSHtmlHeaderTransformer':\n", " {'enabled':False, 'highlight_class':'highlight-ipynb'}})\n", "\n", "exportHtml = HTMLExporter( config=c , filters={'highlight2html': my_highlight} )\n", "(body,resources) = exportHtml.from_notebook_node(jake_notebook)" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "u'

from'"
      ]
     },
     "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": [
      "

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.

\n", "
\n", "FOOOOOOOOTEEEEER\n", "\n" ] } ], "source": [ "from jinja2 import DictLoader\n", "\n", "dl = DictLoader({'html_full.tpl': \n", "\"\"\"\n", "{%- extends 'html_basic.tpl' -%} \n", "\n", "{% block footer %}\n", "FOOOOOOOOTEEEEER\n", "{% endblock footer %}\n", "\"\"\"})\n", "\n", "\n", "exportHtml = HTMLExporter( config=None , filters={'highlight': my_highlight}, extra_loaders=[dl] )\n", "(body,resources) = exportHtml.from_notebook_node(jake_notebook)\n", "for l in body.split('\\n')[-4:]:\n", " print l" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Real World Use" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "@jakevdp use Pelican and IPython Notebook to blog. Pelican [Will use](https://github.com/getpelican/pelican-plugins/pull/21) nbconvert programatically to generate blog post. Have a look a [Pythonic Preambulations](http://jakevdp.github.io/) for Jake blog post." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "@damianavila Wrote a Nicholas Plugin to [Write blog post as Notebook](http://www.damian.oquanta.info/posts/one-line-deployment-of-your-site-to-gh-pages.html) and is developping a js-extension to publish notebooks in one click from the web app." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "

As @Mbussonn requested... easieeeeer! Deploy your Nikola site with just a click in the IPython notebook! http://t.co/860sJunZvj cc @ralsina

— Damián Avila (@damian_avila) August 21, 2013
\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And finaly, what you just did, is replicate what [nbviewer](http://nbviewer.ipython.org) does. WHich to fetch a notebook from url, convert it and send in back to you as a static html." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### A few gotchas" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Jinja blocks use `{% %}`by default which does not play nicely with $\\LaTeX$, hence thoses are replaced by `((* *))` in latex templates." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [] } ], "metadata": {}, "nbformat": 4, "nbformat_minor": 0 }