[IPython-dev] Making custom converter/template with nbconvert

Rafał Skolasiński rjtskolasinski at gmail.com
Fri Jan 2 12:43:48 EST 2015


Hi guys,

My converter starts to take the final form. I am now working on handling
used figures in some clever way.

All of them that are generated in notebooks and are in output fields go in
smooth way.

I have some problem with figures that are put inside text in markdowns,
i.ex. as
![some_caption](files/dot.png)
which goes in html into <img src="dot.png" alt="some_caption" /><p
class="caption">caption</p>
(as a template very similar to basic one).

How can force converter to not skip 'files/' to have src="files/dot.png"?
Probably it lies somewhere in template but I couldn't localize it.

Cheers,
Rafał



2014-12-19 17:57 GMT+01:00 Rafał Skolasiński <rjtskolasinski at gmail.com>:

> Ok. I found it.
> Now the corresponding line should be
> exportHtml =
> HTMLExporter(config=Config({'HTMLExporter':{'template_file':'basic'}}))
> instead of
> exportHtml =
> HTMLExporter(config=Config({'HTMLExporter':{'default_template':'basic'}}))
>
>
> 2014-12-19 17:12 GMT+01:00 Rafał Skolasiński <rjtskolasinski at gmail.com>:
>>
>> Hi guys,
>>
>> I got some kind of working version. It almost do what I want from it (at
>> least for first working version).
>> http://pastebin.com/bi0003LS
>>
>> Of course later there will come more functionality and polishing.
>>
>> Although I got strange problem. It looks like my converter ignores fact I
>> ask it for using 'basic' template.
>>
>> Does the syntax for it changed? I was basing on this old tutorial:
>>
>> http://nbviewer.ipython.org/github/ipython/ipython-in-depth/blob/master/examples/Notebook/Using%20nbconvert%20as%20a%20Library.ipynb
>>
>> Best,
>> Rafal
>>
>> 2014-12-18 22:38 GMT+01:00 Rafał Skolasiński <rjtskolasinski at gmail.com>:
>>>
>>> I will ; - )
>>>
>>> 2014-12-18 22:36 GMT+01:00 Fernando Perez <fperez.net at gmail.com>:
>>>
>>>>
>>>> On Thu, Dec 18, 2014 at 9:06 AM, Rafał Skolasiński <
>>>> rjtskolasinski at gmail.com> wrote:
>>>>>
>>>>> I will let you know if I will encounter any problems.
>>>>
>>>>
>>>> And please post here on the list once you have something up and
>>>> running. It's very important for the project to show how others use it not
>>>> only as an interactive environment, but also as infrastructure to build
>>>> upon.  That's the kind of clear value that helps us secure resources to
>>>> sustain its development.
>>>>
>>>> Best
>>>>
>>>> f
>>>>
>>>>
>>>> --
>>>> Fernando Perez (@fperez_org; http://fperez.org)
>>>> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
>>>> fernando.perez-at-berkeley: contact me here for any direct mail
>>>>
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150102/a8acb956/attachment.html>


More information about the IPython-dev mailing list