Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 53 by Allow PreProc to generate multiple  
input lines

The attached small patch allows PreProc statements to generate multiple  
input lines.
I.e. each line of the output generated by the PreProc is processed as if it  
were a separate input line (and not 1 line containing '\n' characters).
This allows you to do things that are otherwise difficult or impossible.
It uses '\f' (form-feed) in the output expression as the line separator so  
as not to break existing PreProcs that may already use '\n'.
Please feel free to include this in txt2tags.

     Desc: Generate two output elements from a single input line.
     File: Split1.t2t

         %!preproc: 'NOTE{([^,]+),\s*([^}]+)}'  '== \1 ==\f  \2'
         NOTE{A Note, Content of a note.}
     Cmd: txt2tags -i Split1.t2t -o- -t xhtml --no-headers
         <h2>A Note</h2>

             Content of a note.

     Desc: PostProc this to make a table's title appear in the TOC.
     File: Split2.t2t

         %!preproc: 'TABLE{(\w+),\s*([^}]+)}'  '== \2 ==[\1]\f| \2 |'
         TABLE{tbl1, Heading and Table Title}
         | Table contents |
     Cmd: txt2tags -i Split2.t2t -o- -t xhtml --no-headers
         <a id="tbl1" name="tbl1"></a>
         <h2>Heading and Table Title</h2>

         <table border="1" cellpadding="4">
         <td>Heading and Table Title</td>
         <td>Table contents</td>

     Desc: Four line list example.
     File: Split3.t2t

         %!preproc: 'LIST{(.+),(.+),(.+),(.+)}'  ' - \1\f - \2\f - \3\f -  
     Cmd: txt2tags -i Split3.t2t -o- -t xhtml --no-headers

        PreProc Split r297.patch  666 bytes

Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
txt2tags-list mailing list

Reply via email to