[IPython-dev] ipython html notebook: markdown in math mode and backslashes

Aron Ahmadia aron@ahmadia....
Thu Aug 23 10:13:56 CDT 2012


I feel like a jerk, I just checked to see if this problem shows up on our
own gitit+pagedown live renderer, and the same bug is present!  We use
pandoc to do the final render, which is probably why I hadn't noticed it
before.

The StackExchange guys do some special parsing before they hand their code
off to the PageDown parser, you can see it here:

http://cdn.sstatic.net/js/mathjax-editing-new.js

This is probably going to be the most familiar syntax for people used to
LaTex and willing to work with Markdown for their outer formatting.

Digging into the ipython source, the Markdown.converter is initialized in
notebookmain.js then utilized in the textcell.js markdown render function.
 I don't see any special parsing done for handling the math symbols.   I
think the render function in textcell.js would be the right place to add
the math delimiter strip/replace hooks.

If you guys are interested, I can see about getting the SE
mathjax-editing-new.js code licensed for redistribution, the SE guys are
pretty hip to this kind of thing so I don't expect it to be a problem.

A

On Thu, Aug 23, 2012 at 3:29 PM, Aron Ahmadia <aron@ahmadia.net> wrote:

> It's a bit weird that they're using Pagedown for this, because it's mostly
> used for live previews, not rendering.  Something must be misconfigured,
> because Pagedown+MathJax is a pretty standard setup.  I'm digging into the
> code now.
>
> A
>
>
> On Thu, Aug 23, 2012 at 3:15 PM, Thomas Kluyver <takowl@gmail.com> wrote:
>
>> On 23 August 2012 15:13, Aron Ahmadia <aron@ahmadia.net> wrote:
>> > Okay, if the notebook is using python-markdown, it might be as simple as
>> > installing this extension:
>>
>> Unfortunately it's not. All the markdown processing happens in the
>> browser, using Javascript. You can see the code for it here:
>>
>>
>> https://github.com/ipython/ipython/blob/master/IPython/frontend/html/notebook/static/pagedown/Markdown.Converter.js
>>
>> Thanks,
>> Thomas
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20120823/5709cdaa/attachment.html 


More information about the IPython-dev mailing list