Diff: Help/RichTablePlugin

Note: You are viewing an old revision of this page. View the current version.

Differences between version 3 and previous revision of Help/RichTablePlugin.

Other diffs: Previous Major Revision, Previous Author

Newer page: version 3 Last edited on 9 September 2007 0:16 by harold Revert
Older page: version 2 Last edited on 22 May 2014 3:01 by harold Revert
@@ -1,75 +1,53 @@
-The **~RichTable** [[Help:WikiPlugin|plugin]] is a plugin that takes off from the [[Help:OldStyleTablePlugin|OldStyleTable]] plugin. It allows a user to specify arbitrary properties of ##<table>##, ##<tr>## and ##<td>## with a very simple markup.  
  
-This plugin is included for legacy only. We recommand to  
-use [[Help:MediawikiTablePlugin|Mediawiki tables]] instead.  
+! Synopsis  
  
-== Syntax ==  
+The Help:RichTablePlugin is a plugin that takes off from the Help: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.  
  
-The contents of each cell are individually processed by the ~BlockParser. This means that you can do interesting things like put * *invoke plugins* *, use * *enumerated lists* * etc within each cell! 
+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! 
  
-A ## "-"## (dash) at the start of a new line represents a new row in the table. 
+* A <tt> "-"</tt> (dash) at the start of a new line represents a new row in the table.  
+*A <tt>"|"</tt> (vertical bar or pipe) at the start of a new line represents a cell.  
+*Attributes for the tags  
+ *A line that starts with a <tt>"*"</tt> (star or asterisk) after a <tt>"|"</tt> is parsed for attributes for the corresponding cell.  
+ *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.  
+ *A line that starts with a <tt>-</tt> is always parsed for attributes since it can't have any content, unlike a cell.  
+*Cell contents  
+ *Cell contents are processed by the ~BlockParser.  
+ *Any line that starts with a <tt>"*"</tt> anywhere other than the table attribute line is treated as normal content.  
+ *Any line that starts with whitespace is also treated as content.  
+ *Any cell line that does not have a <tt>"*"</tt> after the <tt>"|"</tt> is treated as normal content.  
+ *All content lines that follow a cell line are added to that cell. They can contain arbitrary text except the above cases.  
+ *If there is no cell in the current row, content lines are dropped silently.  
+*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
  
-A ##"|"## (vertical bar or pipe) at the start of a new line represents a cell
+! Bugs  
+* The source code sucks  
+* The plugin can't nest itself yet. Thus nested tables are currently not possible
  
-=== Attributes for the tags ===  
+! Example  
  
-A line that starts with a ##"~*"## (star or asterisk) after a ##"|"## is parsed for attributes for the corresponding cell.  
-  
-Attributes for the table are given on line that starts with a ##"~*"##, only if the line appears before any other line except whitespace.  
-  
-A line that starts with a ##-## is always parsed for attributes since it can't have any content, unlike a cell.  
-  
-=== Cell contents ===  
-  
-Cell contents are processed by the ~BlockParser.  
-  
-Any line that starts with a ##"~*"## anywhere other than the table attribute line is treated as normal content.  
-  
-Any line that starts with whitespace is also treated as content.  
-  
-Any cell line that does not have a ##"~*"## after the ##"|"## is treated as normal content.  
-  
-All content lines that follow a cell line are added to that cell. They can contain arbitrary text except the above cases.  
-  
-If there is no cell in the current row, content lines are dropped silently.  
-  
-=== Special characters ===  
-  
-The two special characters ##"~~"## and ##" ?>"## should be escaped as ##"\~~"## and ##"?\>"##. I havn't discovered any other characters yet that might need to be escaped. This is required for the block parser to work.  
-  
-=== Attributes ===  
-  
-We allow attributes with or without quotes ("):  
-{{{  
-border=1, cellpadding="5"  
-style="font-family: sans-serif; border-top:1px solid #dddddd;"  
-style="font-family: Verdana, Arial, Helvetica, sans-serif"  
-}}}  
-  
-== Example ==  
-  
-<< RichTable 
+< ?plugin RichTable 
  
 *border=1, cellpadding=5, bgcolor=#f0f8f8, width=75%, align=center 
 
 |* colspan=3, align=center 
 HomePage 
 
 |* colspan=2 
-[http://phpwiki.svn .sourceforge.net/viewvc/phpwiki/trunk /themes/default/images/png.png] 
+[http://phpwiki.sourceforge.net/demo /themes/default/images/png.png] 
 |* rowspan=2 
 This cell actually has a plugin invocation inside it! 
 <?plugin 
 BackLinks 
 ?\> 
 - bgcolor=white 
 
-# One  
-# Two 
+#One  
+#Two 
 
-* Foo  
-* Bar 
+*Foo  
+*Bar 
 - bgcolor=cyan 
 This line gets dropped ... no cell to contain it! 
 |* bgcolor=#f0f0ff, align=center 
 One paragraph 
@@ -77,34 +55,34 @@
 Another paragraph? 
 |* align=left 
 This cell uses the row color 
 | I wish this cell had a nested table inside it! :( 
->
+?
  
 The above table is rendered from: 
  
-{{{  
- <<RichTable 
+<verbatim>  
+ <?plugin RichTable 
  
 *border=1, cellpadding=5, bgcolor=#f0f8f8, width=75%, align=center 
 
 |* colspan=3, align=center 
 HomePage 
 
 |* colspan=2 
-[http://phpwiki.svn .sourceforge.net/viewvc/phpwiki/trunk /themes/default/images/png.png] 
+[http://phpwiki.sourceforge.net/demo /themes/default/images/png.png] 
 |* rowspan=2 
 This cell actually has a plugin invocation inside it! 
 <?plugin 
 BackLinks 
 ?\> 
 - bgcolor=white 
 
-# One  
-# Two 
+#One  
+#Two 
 
-* Foo  
-* Bar 
+*Foo  
+*Bar 
 - bgcolor=cyan 
 This line gets dropped ... no cell to contain it! 
 |* bgcolor=#f0f0ff, align=center 
 One paragraph. 
@@ -112,17 +90,14 @@
 Another paragraph? 
 |* align=left 
 This cell uses the row color 
 | I wish this cell had a nested table inside it! :( 
->>  
-}}}  
+? >  
+</verbatim >  
+  
+;<strong>Author</strong>: Sameer D. Sahasrabuddhe  
+;<strong>Url</strong>: http://www.it.iitb.ac.in/~sameerds/phpwiki/index.php/RichTablePlugin  
  
-== Known Bugs ==  
-* The plugin can't nest itself. Thus nested tables are currently not possible. See [[Help:MediawikiTablePlugin|Mediawiki tables]] to have nested tables.  
  
-== Author ==  
-* [[http://www.it.iitb.ac.in/~sameerds/phpwiki/index.php/RichTablePlugin|Sameer D. Sahasrabuddhe]]  
+-------------  
  
-<noinclude>  
-----  
-[[ PhpWikiDocumentation]] [[CategoryWikiPlugin]]  
-</noinclude>  
+PhpWikiDocumentation Help:WikiPlugin  

version 3

Synopsis

The Help:RichTablePlugin is a plugin that takes off from the Help:OldStyleTablePlugin. It allows a user to specify arbitrary properties of <table>, <tr> and <td> with a very simple markup.

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!

*A "-" (dash) at the start of a new line represents a new row in the table. *A "|" (vertical bar or pipe) at the start of a new line represents a cell. *Attributes for the tags

A line that starts with a "*" (star or asterisk) after a "|" is parsed for attributes for the corresponding cell. *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. *A line that starts with a - is always parsed for attributes since it can't have any content, unlike a cell.

*Cell contents

Cell contents are processed by the BlockParser. Any line that starts with a <tt>""</tt> anywhere other than the table attribute line is treated as normal content. *Any line that starts with whitespace is also treated as content. *Any cell line that does not have a <tt>""</tt> after the "|" is treated as normal content. *All content lines that follow a cell line are added to that cell. They can contain arbitrary text except the above cases. *If there is no cell in the current row, content lines are dropped silently.

*The two special characters "~" and "?>" should be escaped as "\~" and "?\>". I havn't discovered any other characters yet that might need to be escaped. This is required for the block parser to work.

Bugs

  • The source code sucks
  • The plugin can't nest itself yet. Thus nested tables are currently not possible.

Example

HomePage

This cell actually has a plugin invocation inside it!

No page links to Help/RichTablePlugin.

#One #Two

*Foo *Bar

One paragraph

Another paragraph?

This cell uses the row color

I wish this cell had a nested table inside it! :(

The above table is rendered from:

<?plugin RichTable

*border=1, cellpadding=5, bgcolor=#f0f8f8, width=75%, align=center
-
|* colspan=3, align=center
HomePage
-
|* colspan=2
[http://phpwiki.sourceforge.net/demo/themes/default/images/png.png]
|* rowspan=2
This cell actually has a plugin invocation inside it!
<?plugin
BackLinks
?\>
- bgcolor=white
|
#One
#Two
|
*Foo
*Bar
- bgcolor=cyan
This line gets dropped ... no cell to contain it!
|* bgcolor=#f0f0ff, align=center
One paragraph.

Another paragraph?
|* align=left
This cell uses the row color
| I wish this cell had a nested table inside it! :(
?>
Author
Sameer D. Sahasrabuddhe
Url
http://www.it.iitb.ac.in/sameerds/phpwiki/index.php/RichTablePlugin

PhpWikiDocumentation Help:WikiPlugin