[IPython-dev] nbconvert and templates

Kiko kikocorreoso at gmail.com
Sat Sep 6 08:25:53 EDT 2014


Hi all

I was trying to make a standard template to export a notebook to a basic
html format in order to provide a simple template with ipy2wp (
https://github.com/Pybonacci/ipy2wp, asnd IPython notebook to html
converter and publisher for the wordpress platform) to allow people to
customise their own templates.

After some hacking I can't avoid all the:

<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="input">

<div class="inner_cell">
<div class="input_area">
<div class="highlight">
...

And other stuff that is introduced with the basic.tpl (html) template.

I can post process the final converted html but I think it would be easier
to do it directly with nbconvert and Jinja2.

Can someone point me to some docs or examples to try to understand how the
conversion is done. I read the exporters code, the preprocessors code, I
tried to learn a little bit about Jinja2 but I'm no able to create a
template to extend basic.tpl and can do what I want. I don't know when all
the nbconvert machinery is adding all this tags, the prompts,...

P.D.: I already looked at nbconvert-examples repo, I googled and tried to
search in the mailist,... :-(
P.D.2: I will try to write something in the wiki or create a notebook
explaining the process in order to let other people customise their own
templates.

Thanks in advance.

Kind regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140906/c1f3519b/attachment.html>


More information about the IPython-dev mailing list