[Doc-SIG] directive for flexible literate programming support?

Frank Siebenlist franks at mcs.anl.gov
Tue Dec 9 14:31:08 EST 2003

Aahz wrote:

> On Tue, Dec 09, 2003, Frank Siebenlist wrote:
>>If not, one option could be to introduce a directive that would specify how 
>>to recognize literate blocks, like:
>>.. literate-block :: ">"
>>which would indicate that for rest of this file, a literate block could 
>>also be identified with a block where the lines start with ">" besides the 
>>normal whitespace indentation.
> Actually, what it would substitute for is Python's interactive mode;
> reST already understands::
>     >>> x = 1

Yes, I looked at that when I started - too bad for my case that "it" was decided 
to use three ">" instead of a single one ;-)

> as belonging to a literal block that comes from Python's interactive
> mode.  The main problem for your request is the interface; do we only
> allow simple strings?  What about regexes?  What about plug-in code?

Just for my case and probably the formatting of literate code snippets in 
general, a simple string would suffice.

I can't think of any use cases where you would need the added complexity of 
regexes, while I don't know what "plug-in code" is but is sounds scary from a 
complexity point of view...


Frank Siebenlist               franks at mcs.anl.gov
The Globus Alliance - Argonne National Laboratory

More information about the Doc-SIG mailing list