← Back to team overview

zim-wiki team mailing list archive

Re: Zim and ipython

 

On Thu, Jun 14, 2012 at 11:14 PM, Greg Warner <gdwarner@xxxxxxxxx> wrote:
> Have you seen the ipython notebook (see http://youtu.be/HaS4NXxL5Qc)?
>
> To answer your question, I have mixed feelings about the idea of embedding
> ipython in zim.  I think it would be a really neat and novel feature.  I
> think it would take considerable effort if you wanted it to be on-par with
> the rich feature set that the qt and notebook ipython interfaces have
> (graphing, input, realtime output, etc). And lastly, I think there are
> higher-priority features such as table support and, speaking of python, code
> syntax highlighting.
>
> Greg
>
> On Thu, Jun 14, 2012 at 1:21 PM, Thomas Douillard
> <thomas.douillard@xxxxxxxxx> wrote:
>>
>> Hello dear zim developpers and users !
>>
>> I started to use zim a few months ago and I think it's a great tool to
>> take notes and to organize my works amongs over uses.
>> Actually It seems it's a tool I always wanted and I am addicted.
>>
>> To get to the object of my message, I took a look at the ipython project a
>> few days ago, and it seems to share some of it spirit and even some use
>> cases with zim, especially the ipython console, wich is to me like an
>> especially powerful zim-wiki page used with some plugins like the arithmetic
>> and graphs one.
>>
>> Of course it is a lot more powerful and complex, but I wonder if a plugin
>> that would allow to embed and edit an ipython notebook page into a zim-wiki
>> notebook would interest some people. Without looking in depth into the
>> respective source code I believed it would be possible to do such a thing
>> without much effort considering the two projects shares a lot of bases.
>>
>> What do you think of this idea ? I might take a look into this if the
>> answer here is positive.

I think it really depends on how to integrate exactly. If a simple
plugin can wrap it and embed it that might be a great tool, but if it
means re-implementing a client for ipython, I tend to agree with Greg
that there are more pressing tasks to work on.

Directly embedding the client is probably hard as it seems to be
written in the QT toolkit. Only if their code has a really strict
separation of function and interface code, it may be feasible to
re-implement the interface parts in Gtk.

Two scenarios I can imagine for embedding

1/ Only embed plots - basically re-use the "insert gnuplot" or "insert
R plot" plugins. Write a script, execute with ipython and insert the
resulting plot. If the objective is to get nice graphics it will work,
but no interaction.

2/ Try to re-use the code from the HTML notebook. Would need to hack a
"HTML import" to get it in zim, but that is probably not so hard. Not
sure how the "save session" mechanism works. If it allows us to push
back a zim page as a saved session it *may* be doable to get it
interactive.

So the short answer is look at the code and try to hack a thin wrapper
to push input and output between zim and ipython.

Regards,

Jaap


References