[IPython-dev] extension to support reStructuredText. how to start?

Brian Granger ellisonbg at gmail.com
Mon Jun 23 17:36:00 EDT 2014


OK great.

This work will require hacking on and using IPython JavaScript APIs
that are unstable and uncodumented (in any useful way). Some pointers:

* You can put files into .ipython/profile_default/static that match
the name and location of those in IPython's static dir and the web app
will use them instead. This will allow you to create a custom version
of our internal files.
* I would start by trying to create a custom version of textcell.js
that adds Markdown cell like logic to the raw cells to see what is
needed. The Markdown cell is a good starting place as it already knows
how to manage the raw and rendered versions.
* The way I would handle the rendering of the rst is to have a global
"Render Rst" button in the toolbar that will render all of the cells.
This button will grab all of the contents of the raw rst cells, call
out to the Rst Rendering REST web service and call the proper methods
on the raw cells to put the rendered version into place.
* I would write and run the rst RESt service as a separate web server
that sets CORS headers to allow the main notebook server to connect to
it.
* You will have to grab global references to the notebook instance.
With changes about to be merged into master, you will have to use
require.js to get this reference - it might be a bit tricky
though...but we can help...

Cheers,

Brian

On Mon, Jun 23, 2014 at 2:19 PM, Martín Gaitán <gaitan at gmail.com> wrote:
> On Mon, Jun 23, 2014 at 5:35 PM, Brian Granger <ellisonbg at gmail.com> wrote:
>>
>> In the past we have said that we don't have plans on supporting rst
>> cells. Given recent developments (especially integration with Google
>> Drive) I think we are even further away from ever supporting rst
>> cells.
>
>
> This was pretty clear in the PR thread and in the hangout meeting I linked,
> and the option B is what I want to do and asking about.
>
> I've did a couple of ipython extensions (magics) but anything yet involving
> comm/widgets. The doc at this point doesn't seem to be very complete and I
> really don't know how to start.
>
> For example, which would be the "event" triggered when I a raw cell is
> "executed" ? how can I bind that event to send the whole notebook data to a
> python function? how this function return the html to the notebook? How can
> I replace each raw cell with a "rendered" version?
>
> thanks in advance
>
> --
> mgaitan.github.io
> textosypretextos.com.ar
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger at calpoly.edu and ellisonbg at gmail.com



More information about the IPython-dev mailing list