[IPython-User] nbconvert converts to/from IPyNB or just from IPyNb?

Matthias BUSSONNIER bussonniermatthias@gmail....
Sun Feb 24 04:43:00 CST 2013


Le 24 févr. 2013 à 01:39, Nitin Borwankar a écrit :

> Hi Matthias,
> 
> Thanks very much for the prompt response.
> Authoring my content in .rst instead of .md is not much of a burden. So I will try that. pandoc is our friend.
> 
> Just one caveat - running nosetests on git trunk of nbconvert gave an error that unfort. seems like it is connected with .rst --> ipynb converter.  does this affect the ability to run .rst --> ipynb?
> Error Msg at the end - I don't know enough to interpret.
> Could you please clarify?  I did a git pull a couple of hours ago.
> 
> Other than that - yes I have become very familiar with %%R magics over last month or so and have even learnt how to use ggplot2 inside IPython :-).  You might recall a bug in the %R line magic I reported here a month or so ago - thankfully %%R still works and that's what I really need so no problems there.
> 
> The point is that I don't want to tightly couple the R snippets into the expository content and then have to cut and paste NumPy or MATLAB or ....manually each time - a JSON object (or even text content for that matter) is "software" and maintenance of multiple variations, with cut and paste will create nightmares very rapidly.
> 
> The beauty of the IPyNB format is that since it is text friendly and conversion friendly multiple variations (note variations not revisions) of the same Notebook can be created using a single text template and varying %%language magics injected in at build time by a command line switch.
> 
> So my goal is to have some placeholder markers in the text content where the language magics go and have a switch at build time so one or more or all variations can be created without cut and paste.
> 
> Right now if .rst  --> .ipynb is working (please see errors below and let me know) then that is a good workaround. Pandoc is our good friend.
> 
> 



> ~/git/ipythongit/nbconvert(master)]$ nosetests
> .........F./Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/tutorial.rst.ref:27: (ERROR/3) Unknown interpreted text role "ref".
> /Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/tutorial.rst.ref:48: (ERROR/3) Unknown interpreted text role "ref".
> /Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/tutorial.rst.ref:84: (ERROR/3) Unknown interpreted text role "ref".
> /Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/tutorial.rst.ref:127: (ERROR/3) Unknown interpreted text role "ref".
> /Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/tutorial.rst.ref:157: (ERROR/3) Unknown interpreted text role "ref".
> /Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/tutorial.rst.ref:157: (ERROR/3) Unknown interpreted text role "ref".
> /Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/tutorial.rst.ref:190: (ERROR/3) Unknown interpreted text role "ref".

Don't worry about those. 

> .........
> ======================================================================
> FAIL: test_references.test_evens(<class 'converters.html.ConverterHTML'>, 'tests/ipynbref/IntroNumPy.orig.ipynb', 'tests/ipynbref/IntroNumPy.orig.html')
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/Applications/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
>     self.test(*self.arg)
>   File "/Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/test_references.py", line 58, in test_conversion
>     compfiles(cv, value)
>   File "/Volumes/HybridSeagate/my/code/git/ipythongit/nbconvert/tests/test_references.py", line 48, in compfiles
>     cleanfile(strb))
> AssertionError: Lists differ: [u'<html>', u'<head>', u'<styl... != [u'<html>', u'<head>', u'<styl...
> 
> First differing element 186:
> #notification {
> #notification_area {

This is just because the tests references are built on 0.13.1 and you are running a dev version of IPython I guess. Or other way around I never remember
As nbconvert extract the css from the IPython dir it just see a difference between your css and mine.
-- 
Matthias



More information about the IPython-User mailing list