[Zope-dev] Structured Text and tables.
Pavlos Christoforou
pavlos@gaaros.msrc.sunysb.edu
Mon, 12 Apr 1999 22:22:41 -0400 (EDT)
Zopistas
Reading through the source of the latest version I found a bug. If a
paragraph is a list item and ends with 'example:' or '::' then the
enclosing paragraph is not rendered as example code. (If you render the
module's __doc__ string the bug should be apparent). I fixed it in the
obvious and inefficient way.
Additionaly I added support for simple tables. From the doc string:
- A paragraph that has blocks of text enclosed in '||' is treated as a
table. The text blocks correspond to table cells and table rows are
denoted by newlines. By default the cells are center aligned. A cell
can span more than one column by preceding a block of text with an
equivalent number of cell separators '||'. Newlines and '|' cannot
be a part of the cell text. For example:
|||| **Ingredients** ||
|| *Name* || *Amount* ||
||Spam||10||
||Eggs||3||
is interpreted as::
<TABLE BORDER=1 CELLPADDING=2>
<TR>
<TD ALIGN=CENTER COLSPAN=2> <strong>Ingredients</strong> </TD>
</TR>
<TR>
<TD ALIGN=CENTER COLSPAN=1> <em>Name</em> </TD>
<TD ALIGN=CENTER COLSPAN=1> <em>Amount</em> </TD>
</TR>
<TR>
<TD ALIGN=CENTER COLSPAN=1>Spam</TD>
<TD ALIGN=CENTER COLSPAN=1>10</TD>
</TR>
<TR>
<TD ALIGN=CENTER COLSPAN=1>Eggs</TD>
<TD ALIGN=CENTER COLSPAN=1>3</TD>
</TR>
</TABLE>
You can download the new version of StructuredText.py that includes
support for simple tables from:
http://www.gaaros.com:9673/FAQ/StructuredText
Enjoy
Pavlos