Pargraph & Table
authorrgbecker
Tue, 11 Jul 2000 12:37:20 +0000
changeset 349 d96f5098af2b
parent 348 218d4b40a55d
child 350 0916ae478b25
Pargraph & Table
docs/userguide/ch5_paragraphs.py
docs/userguide/ch6_tables.py
--- a/docs/userguide/ch5_paragraphs.py	Tue Jul 11 11:20:23 2000 +0000
+++ b/docs/userguide/ch5_paragraphs.py	Tue Jul 11 12:37:20 2000 +0000
@@ -148,12 +148,12 @@
 """)
 disc(" ")
 
-from reportlab.platypus.paraparser import _addAttributeNames, _paraAttrMap
+from reportlab.platypus.paraparser import _addAttributeNames, _paraAttrMap, _bulletAttrMap
 
 def getAttrs(A):
     _addAttributeNames(A)
     S={}
-    for k, v in _paraAttrMap.items():
+    for k, v in A.items():
         a = v[0]
         if not S.has_key(a):
             S[a] = k
@@ -232,7 +232,7 @@
          "Greek letters and subscripts")
 
 heading3("Numbering Paragraphs and Lists")
-disc("""The $<seq>$ tag provides comprehensive support
+disc("""The $&lt;seq&gt;$ tag provides comprehensive support
 for numbering lists, chapter headings and so on.  It acts as
 an interface to the $Sequencer$ class in ^reportlab.lib.sequencer^.
 These are used to number headings and figures throughout this
@@ -241,7 +241,7 @@
 with the $id$ attribute; these will be incremented by one each
 time they are accessed.  The $seqreset$ tag resets a counter.
 If you want it to resume from a number other than 1, use
-the syntax &lt;seqreset id="mycounter" base="42"&gt;. 
+the syntax &lt;seqreset id="mycounter" base="42"&gt;.
 Let's have a go:""")
 
 parabox2("""<seq id="spam"/>, <seq id="spam"/>, <seq id="spam"/>.
@@ -289,7 +289,21 @@
 idea is to select the Symbol font in the style, and
 use a character such as $\\267)$:""")
 
+t=apply(Table,getAttrs(_bulletAttrMap))
+t.setStyle([
+            ('FONT',(0,0),(-1,1),'Times-Bold',10,12),
+            ('FONT',(0,1),(-1,-1),'Courier',8,8),
+            ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
+            ('INNERGRID', (0,0), (-1,-1), 0.25, colors.black),
+            ('BOX', (0,0), (-1,-1), 0.25, colors.black),
+            ])
+getStory().append(t)
 
+caption("""Table <seq template="%(Chapter)s-%(Table+)s"/> - &lt;bullet&gt; attributes &amp; synonyms""")
+disc("""The &lt;bullet&gt; tag is only allowed onec in a given paragraph and its use
+overrides the implied bullet style and ^bulletText^ specified in the  ^Paragraph^
+creation.
+""")
 parabox("""<bullet>\267</bullet>this is a bullet point.  Spam
 spam spam spam spam spam spam spam spam spam spam spam 
 spam spam spam spam spam spam spam spam spam spam """,
--- a/docs/userguide/ch6_tables.py	Tue Jul 11 11:20:23 2000 +0000
+++ b/docs/userguide/ch6_tables.py	Tue Jul 11 12:37:20 2000 +0000
@@ -50,15 +50,15 @@
 That is later applications override earlier ones where thes overlap.
 """)
 
-heading3('$class TableStyle$')
+heading2('$class TableStyle$')
 disc("""
 This $class$ is created by passing it a sequence of <i>commands</i>, each command
 is a tuple identified by its first element which is a string; the remaining
 elements of the command tuple represent the start and finish cell coordinates
 of the command and possibly thickness and colors etc.
 """)
-heading3("$TableStyle$ User Methods")
-heading4("$TableStyle(commandSequence)$")
+heading2("$TableStyle$ User Methods")
+heading3("$TableStyle(commandSequence)$")
 disc("""The creation method initializes the $TableStyle$ with the argument
 command sequence as an example:""")
 eg("""
@@ -69,19 +69,19 @@
         ('ALIGN', (1,1), (-1,-1), 'RIGHT')]
         )
 """)
-heading4("$TableStyle.add(commandSequence)$")
+heading3("$TableStyle.add(commandSequence)$")
 disc("""This method allows you to add commands to an existing
 $TableStyle$, ie you can build up $TableStyles$ in multiple statements.
 """)
 eg("""
     LIST_STYLE.add([('BACKGROUND', (0,0), (-1,0), colors.Color(0,0.7,0.7))])
 """)
-heading4("$TableStyle.getCommands()$")
+heading3("$TableStyle.getCommands()$")
 disc("""This method returns the sequence of commands of the instance.""")
 eg("""
     cmds = LIST_STYLE.getCommands()
 """)
-heading3("$TableStyle$ Commands")
+heading2("$TableStyle$ Commands")
 disc("""The commands passed to $TableStyles$ come in three main groups
 which affect the table background, draw lines, or set cell styles.
 """)
@@ -95,7 +95,7 @@
 The top left cell is (0,0) the bottom right is (-1,-1). Depending on
 the command various extra occur at indeces beginning at 3 on.
 """)
-heading4("""$TableStyle$ Cell Formatting Commands""")
+heading3("""$TableStyle$ Cell Formatting Commands""")
 disc("""The cell formatting commands all begin with an identifier, followed by
 the start and stop cell definitions and the perhaps other arguments.
 the cell formatting commands are:""")
@@ -140,7 +140,7 @@
                         ('BOX', (0,0), (-1,-1), 0.25, colors.black),
                         ]))
 """)
-heading4("""$TableStyle$ Line Commands""")
+heading3("""$TableStyle$ Line Commands""")
 disc("""
     Line commands begin with the identfier, the start and stop cell coordinates
     and always follow this with the thickness (in points) and color of the desired lines. Colors can be names,