Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!uio.no!nntp.uib.no!svn.schaathun.net!not-for-mail From: Hans Georg Schaathun Newsgroups: comp.lang.python Subject: Re: Literate Programming Date: Fri, 8 Apr 2011 10:01:55 +0100 Organization: University of Bergen Lines: 68 Message-ID: <3hv278-be4.ln1@svn.schaathun.net> References: NNTP-Posting-Host: vannskorpion.bccs.uib.no X-Trace: toralf.uib.no 1302253140 40504 129.177.20.20 (8 Apr 2011 08:59:00 GMT) X-Complaints-To: abuse@uib.no NNTP-Posting-Date: 8 Apr 2011 08:59:00 GMT User-Agent: slrn/pre1.0.0-18 (Linux) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2830 On Thu, 07 Apr 2011 16:21:52 -0500, Robert Kern wrote: : http://sphinx.pocoo.org/markup/code.html : : As far as I can tell, it just works. See here for an example: : : http://ipython.scipy.org/doc/nightly/html/interactive/reference.html Maybe I did not express myself clearly. I don't have a problem with highlighting or indentation within a single, complete and continuous block of code. I get trouble when I insert explaining text within nested blocks, especially when I do it at different levels of indentation. In the pages you cite, I cannot find a single example which tries to do this. So something like this is fine: # This is a long and complex block:: if mytest(): for i in myList(): foobar(i) else: for i in yourList(): boofar(i) If I do the following, sphinx cannot keep up ... # This block should be explained step by step:: if mytest(): # Bla, blah blah... # # :: for i in myList(): # The :func:`foobar` function is an interesting choice here ... blah # # :: foobar(i) # Otherwise, myList might not be defined, so we need yours:: else: # More blah... # # :: for i in yourList(): # And here we go again:: boofar(i) Highlighting tends to break starting from `else', and indentation breaks at the second or third level. -- :-- Hans Georg