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

Aahz aahz at pythoncraft.com
Tue Dec 9 13:41:53 EST 2003


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

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?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.



More information about the Doc-SIG mailing list