]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FRichTablePlugin
major pgsrc restructuring: internal doc into Help/*
[SourceForge/phpwiki.git] / pgsrc / Help%2FRichTablePlugin
1 Date: Sun, 4 Jul 2004 01:31:02 -0700
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.8a)
3 X-Rcs-Id: $Id: Help%2FRichTablePlugin,v 1.1 2005-11-21 22:19:00 rurban Exp $ 
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FRichTablePlugin;
6   flags="";
7   author=ReiniUrban;
8   version=1;
9   lastmodified=1075205974;
10   author_id=ReiniUrban;
11   markup=2;
12   charset=iso-8859-1
13 Content-Transfer-Encoding: binary
14
15 RichTablePlugin is a plugin that takes off from the OldStyleTablePlugin. It allows a user to specify arbitrary properties of <tt><table></tt>, <tt><tr></tt> and <tt><td></tt> with a very simple markup.
16
17 NEW: The plugin is now fixed so that the contents of each cell are individually processed by the ~BlockParser. This means that if everything works correctly,  you can do interesting things like put *invoke plugins*, use *enumerated lists* etc within each cell!
18
19 *A <tt>"-"</tt> (dash) at the start of a new line represents a new row in the table.
20 *A <tt>"|"</tt> (vertical bar or pipe) at the start of a new line represents a cell.
21 *Attributes for the tags
22   *A line that starts with a <tt>"*"</tt> (star or asterisk) after a <tt>"|"</tt> is parsed for attributes for the corresponding cell.
23   *Attributes for the table are given on line that starts with a <tt>"*"</tt>, only if the line appears before any other line except whitespace.
24   *A line that starts with a <tt>-</tt> is always parsed for attributes since it can't have any content, unlike a cell.
25 *Cell contents
26   *Cell contents are processed by the ~BlockParser.
27   *Any line that starts with a <tt>"*"</tt> anywhere other than the table attribute line is treated as normal content.
28   *Any line that starts with whitespace is also treated as content.
29   *Any cell line that does not have a <tt>"*"</tt> after the <tt>"|"</tt> is treated as normal content.
30   *All content lines that follow a cell line are added to that cell. They can contain arbitrary text except the above cases.
31   *If there is no cell in the current row, content lines are dropped silently.
32 *The two special characters <tt>"~~"</tt> and <tt>"?>"</tt> should be escaped as <tt>"\~~"</tt> and <tt>"?\>"</tt>. I havn't discovered any other characters yet that might need to be escaped. This is required for the block parser to work.
33
34 Bugs:
35 * The source code sucks
36 * The plugin can't nest itself yet. Thus nested tables are currently not possible.
37
38 Example:
39
40 <?plugin RichTable
41
42 *border=1, cellpadding=5, bgcolor=#f0f8f8, width=75%, align=center
43 -
44 |* colspan=3, align=center
45 HomePage
46 -
47 |* colspan=2
48 [http://phpwiki.sourceforge.net/demo/themes/default/images/png.png]
49 |* rowspan=2
50 This cell actually has a plugin invocation inside it!
51 <?plugin
52 BackLinks
53 ?\>
54 - bgcolor=white
55 |
56 #One
57 #Two
58 |
59 *Foo
60 *Bar
61 - bgcolor=cyan
62 This line gets dropped ... no cell to contain it!
63 |* bgcolor=#f0f0ff, align=center
64 One paragraph
65
66 Another paragraph?
67 |* align=left
68 This cell uses the row color
69 | I wish this cell had a nested table inside it! :(
70 ?>
71
72 The above table is rendered from:
73
74 <verbatim>
75 <?plugin RichTable
76
77 *border=1, cellpadding=5, bgcolor=#f0f8f8, width=75%, align=center
78 -
79 |* colspan=3, align=center
80 HomePage
81 -
82 |* colspan=2
83 [http://phpwiki.sourceforge.net/demo/themes/default/images/png.png]
84 |* rowspan=2
85 This cell actually has a plugin invocation inside it!
86 <?plugin
87 BackLinks
88 ?\>
89 - bgcolor=white
90 |
91 #One
92 #Two
93 |
94 *Foo
95 *Bar
96 - bgcolor=cyan
97 This line gets dropped ... no cell to contain it!
98 |* bgcolor=#f0f0ff, align=center
99 One paragraph.
100
101 Another paragraph?
102 |* align=left
103 This cell uses the row color
104 | I wish this cell had a nested table inside it! :(
105 ?>
106 </verbatim>
107
108 ;__Author__: Sameer D. Sahasrabuddhe
109 ;__Url__: http://www.it.iitb.ac.in/~sameerds/phpwiki/index.php/RichTablePlugin
110
111
112 -------------
113
114 PhpWikiDocumentation Help:WikiPlugin