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

Frank Siebenlist franks at mcs.anl.gov
Tue Dec 9 13:11:53 EST 2003


I'm currently using rst to write haskell literate programs.

The haskell interpreter will recognize the text as code if a line starts with a ">".

To set the code apart, I use "Literal Blocks" for the code snippets.

Unfortunately, a literate block has to be indented, which doesn't work well with 
the interpreter. So I use a one line script to change the " >" into ">" to get 
rid of the space in the first column, before feeding it to the interpreter.

This is not convenient and not very elegant...

Are there maybe other existing ways to make this easier?

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.

Thanks, Frank.

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




More information about the Doc-SIG mailing list