[IPython-User] ipython notebook codeblock with greaterthan

Matthias BUSSONNIER bussonniermatthias@gmail....
Tue Jan 15 03:27:23 CST 2013


Le 15 janv. 2013 à 07:20, Jakob Gager a écrit :

> Actually, this behavior is intended since a greater sign at the beginning of the line
> indicates a blockquote in markdown (see http://daringfireball.net/projects/markdown/syntax#blockquote)
> 
> To really get a greater sign (and no blockquote) you can use the html code > (don't forget the semicolon).
> 
> #> ls.dat  # works fine!

I would suggest avoiding html entities, That would not support conversion to Tex/rst/pdf… with nbconvert. 
Usually you can escape the Markdown delimiter with \ (backslash), it does not work on this case, 
but starting the line with a non breaking space does the trick here.

Indenting 4 spaces is also a way to render block of code, > will not be interpreted as block quote. 

Just FYI

Thanks.
-- 
Matthias




> 
> Jakob
> 
> On 01/14/2013 06:31 PM, William Trimble wrote:
>> I've found that if a comment line has a>  (greater-than sign) for the
>> first non-whitespace character, it does not render in a fixed-width font
>> in ipython notebook (0.13.1, Mac firefox 18):
>> 
>> #<nbformat>3</nbformat>
>> #<markdowncell>
>> # ``
>> # ls>  ls.dat # one line - displays correctly
>> # ``
>> #<markdowncell>
>> # ``
>> # ls \
>> #>  ls.dat  # two lines - displays as regular text
>> # ``
>> #<codecell>
>> 
>> This looks like a minor comment-parsing bug.
>> 
>> Is there an escaping procedure that gets around this problem?  Html
>> entities don't render in codeblocks.
>> 
>> Will Trimble
>> 
>> 
>> 
>> 
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
> 
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user



More information about the IPython-User mailing list