[IPython-dev] [sympy] Re: using reST for representing the notebook cells+text

Brian Granger ellisonbg at gmail.com
Wed Feb 24 14:15:15 EST 2010


> I will do reST import/export, but having it the default format, that I
> think sucks. With xml, anyone can easily write a parsers for it in any
> language.
>
> Besides, I need to push the worksheet to the browser. In my case, I
> use pyjamas, so it's pure Python, however, exec/eval are not evailable
> there (as far as I know), but I am sure xml would work, here is some
> code to handle xml in pyjamas:

A point of clarification.  The Notebook and Cell objects would not be
responsible
for the execution of python code.  The execution logic would simply
pull InputCells
out of the Notebook, extract the python code (as a str) and return the
OutputCell.

[Thinking out loud about what this might look like in a web
browser....more thought needed]

The Python Notebook and Cell objects would not be pyjamas entities - that
part of the python code would not be compiled to Javascript.  The
Notebook and Cell
objects would live in the web server and be capable of rendering
themselves as json
or html.

The pyjamas classes would contain the logic for the user interface,
and calling out to the
Notebook/Cell web service and pass XML/json back and forth....

> I think, that it might work to push the whole Python objects somehow
> (that's the nice thing about pyjamas, that since you have python on
> both sides, you can do lots of cool stuff), but maybe not.

Yes, that might work.  I have been thinking about the Cell objects as having
all the logic needed to render itself in various formats.  But maybe a
Cell object
itself could be lighter weight - the rendering logic could be a separate class.
Then the Cell objects could be compiled to JS using pyjamas.  But I am
not familiar
with how pyjamas works enough to see if this would work.

> I like Brian's idea to be able to just import it in Python. But I
> think I'll just stick to xml for the first iteration of my notebook,
> to get the job done.

Definitely don't wait for me to implement my idea...I do agree with
your statement about
the ease of parsing XML though.

Cheers,

Brian

> Ondrej
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the IPython-dev mailing list