[IPython-dev] Right to left markdown in IPython (1.0)
Ronen Abravanel
ronena at gmail.com
Sun Aug 25 16:11:44 EDT 2013
The issue itself is general, but all the response are about editing, which
seems for me less important then display. My 'extension' tries to solve
the display part.
Markdown dose not define any behavior for RTL text, and all I found online
is some hacks (like the one I used). Real solution will be to extend
markdown (marked?) both for implicit Right-to-left (like bidiweb is doing)
and explicit (invent some 'set RTL' mark?). But that's seems for me event
outside the scope of IPython.
On Sun, Aug 25, 2013 at 11:05 PM, Kyle Kelley <rgbkrk at gmail.com> wrote:
> Oh. This is important for all the RTL languages. Great ideas.
>
> It looks like @amitkot added this as an issue on GitHub:
> https://github.com/ipython/ipython/issues/3278.
>
> Wonder if there's a way to detect it when rendering it.
>
>
> On Sun, Aug 25, 2013 at 2:54 PM, Ronen Abravanel <ronena at gmail.com> wrote:
>
>> Hello all,
>>
>> I'm planning a python class, and my hope is to present it as "live
>> reavel"[1] interactive presentation
>>
>> On of my problems is that I want some of the text and explanations to be
>> in Hebrew, e.g., be written from right to left, which markdown dose not
>> support.
>>
>> One option is to write html with dir=rtl inside the markdown block, but
>> then I have to write all-html, which is incontinent.
>>
>> another option is to use this cool bidiweb[2] script.
>> bidiweb can operate in two modes:
>> 1. Process html (as returned from the markdown processor) and add dir=rtl
>> when needed.
>> 2. Post process the page (searching for specific class and add
>> right-to-left tags when needed)
>>
>> In IPython 0.13, option seems cool, as pagedown, the markdown
>> implementation used, supported post processing hook.
>>
>> In IPython 1.0, I did the following:
>> custom.js:
>>
>> "using strict";
>>
>> requirejs.config({
>> shim: {
>> 'bidiweb.style': ['bidiweb']
>> }
>> });
>>
>> $([IPython.events]).on('app_initialized.NotebookApp', function(){
>> require(['custom/bidiweb'],function(style){
>> bidiweb.style('.rendered_html *');
>> })
>>
>> });
>>
>>
>> +custom.css with .rtl and .ltr definitions.
>>
>> This work only partially: It's add RTL support to the markdown blocked
>> that exists when the page is loaded, but when I add new markdown or edit
>> existing one, the RTL is killed.
>> Is there any way to call bidiweb.style whenever a markdown blocked is
>> update? or any good way to use mode 1 without changing IPython's code?
>>
>>
>> Thanks,
>> Ronen Abravanel
>>
>>
>>
>> [1] http://www.youtube.com/watch?v=bCb2HJy-yc0 I hoped it will be usable
>> and published by the end of October. otherwise, I'll just present a
>> notebook.
>> [2] https://github.com/hasenj/bidiweb
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130825/0ded3530/attachment.html>
More information about the IPython-dev
mailing list