Most recent edit on 2008-09-02 03:00:30 by DarTar [links to docs]
Additions:
Deletions:
Edited on 2008-09-02 03:00:13 by DarTar [links to docs]
Additions:
Deletions:
Edited on 2008-09-01 20:52:14 by BrianKoontz [Updated SVN info]
Additions:
Note
This feature is under development and can be tested using the
SVN trunk version. Note that the syntax for tables is likely to change until a stable version is released. Please do not invest much time in creating (advanced) tablemarkup yet!
Deletions:
Note
This feature is under development and can be tested using the SVN version. Note that the syntax for tables is likely to change until a stable version is released. Please do not invest much time in creating (advanced) tablemarkup yet!
2006-06-21
Patch committed to the SVN repository - to be included in
1.1.6.3:
Patched files:
Edited on 2008-07-12 11:50:48 by BrianKoontz [restored link]
Additions:
Deletions:
- more examples∞ You must create an account to access, invite code is 'demo' Temporarily offline
Edited on 2008-07-12 00:10:03 by BrianKoontz [examples temporarily off-line]
Additions:
- more examples∞ You must create an account to access, invite code is 'demo' Temporarily offline
Deletions:
Edited on 2008-07-09 02:55:34 by TormodHaugen [Removed link to my wiki, as it is down.]
Deletions:
Edited on 2008-01-28 00:13:29 by DarTar [Modified links pointing to docs server]
No differences.
Edited on 2006-11-14 10:33:33 by DarTar [moving note to top]
Additions:
Note
This feature is under development and can be tested using the SVN version. Note that the syntax for tables is likely to change until a stable version is released. Please do not invest much time in creating (advanced) tablemarkup yet!
See also
Deletions:
See also
NOTE! Markup for tables are subject to change. Please do not invest much time in creating (advanced) tablemarkup yet!
Edited on 2006-07-02 16:42:42 by TormodHaugen [added warning]
Additions:
NOTE! Markup for tables are subject to change. Please do not invest much time in creating (advanced) tablemarkup yet!
Edited on 2006-06-22 07:21:38 by DarTar [adding link to test server with complex table examples]
Additions:
Edited on 2006-06-21 14:45:50 by TormodHaugen [removed outdated code]
Deletions:
Code
Patches for download
It seems as if there might be some trouble with grabbing and patching the code; these files are tested against the 1.1.6.2 download and should work:
Patches are for Wikka Wakka Wiki 1.1.6.2. Should be easy to implement manually (or fuzzy) for other versions.
To pach a file under Linux; put the patch file in the same directory as the file itself and run with the command:
patch -p0 -l < patch_name.patch
Revert (uninstall ;)) with the command:
patch -p0 -l -R < patch_name.patch
Save as simpletables.patch in ./formatters/ and apply from there (or do it manually).
--- wakka.php.orig
2006-
06-
14 18:
42:
49.
000000000 +
0200
+++ wakka.php
2006-
06-
14 18:
42:
55.
000000000 +
0200
@@ -
26,
6 +
26,
7 @@
static $indentClosers =
array();
static $newIndentSpace=
array();
static $br =
1;
+
static $trigger_table =
0;
static $trigger_bold =
0;
static $trigger_italic =
0;
static $trigger_underline =
0;
@@ -
48,
6 +
49,
9 @@
if ((!
is_array($things)) &&
($things ==
'closetags'))
{
+
if (2 <
$trigger_table) echo ('</th></tr>');
+
else if (1 <
$trigger_table) echo ('</td></tr>');
+
if (0 <
$trigger_table) echo ('</table>');
if ($trigger_strike %
2) echo ('</span>');
if ($trigger_notes %
2) echo ('</span>');
if ($trigger_inserted %
2) echo ('</span>');
@@ -
59,
11 +
63,
68 @@
if ($trigger_bold %
2) echo('</strong>');
for ($i =
1;
$i<=
5;
$i ++
)
if ($trigger_l[$i] %
2) echo ("</h$i>");
-
$trigger_bold =
$trigger_center =
$trigger_floatl =
$trigger_inserted =
$trigger_deleted =
$trigger_italic =
$trigger_keys =
0;
+
$trigger_bold =
$trigger_center =
$trigger_floatl =
$trigger_inserted =
$trigger_deleted =
$trigger_italic =
$trigger_keys =
$trigger_table =
0;
$trigger_l =
array(-
1,
0,
0,
0,
0,
0);
$trigger_monospace =
$trigger_notes =
$trigger_strike =
$trigger_underline =
0;
return;
}
+
if ( preg_match("/^\|(\?)(.*?)?\|(\n)?$/",
$thing,
$matches) ) {
+
if ( $trigger_table ==
0 ) {
+
$trigger_table =
1;
+
//TODO escape text for safety
+
return '<table class="wikka" summary="'.
$matches[2].
'">'.
"\n";
+
}
+
}
+
// table. trigger means: 0==no table, 1==in table no cell, 2==in table data cell, 3==in table header cell
+
else if ( preg_match("/^\|(=|!)?(\d*)?(?:,)?(\d*)?\|(\n)?$/",
$thing,
$matches) ) {
+
//First catch is header|caption|summary, second is colspan, third is rowspan, fourth is linebreak.
+
if ( $trigger_table ==
0 )
+
{
+
$rs =
"<table class=\"wikka\">\n";
+
if ($matches[1] ==
"!") {
+
$trigger_table =
4;
+
return $rs.
"<caption>";
+
} else {
+
$rs .=
"<tr>";
+
}
+
}
+
else if ( $trigger_table ==
1 ) {
+
if ($matches[1] ==
"!") {
+
$trigger_table =
4;
+
return "<caption>";
+
} else {
+
$rs =
"<tr>";
+
}
+
}
+
else if ( $trigger_table ==
2 ) $rs =
"</td>";
+
else if ( $trigger_table ==
3 ) $rs =
"</th>";
+
else if ( $trigger_table ==
4 ) {
+
$trigger_table =
1;
+
return "</caption>\n";
+
}
+
+
if ( $trigger_table >
1 &&
$matches[4] ==
"\n") {
+
$trigger_table =
1;
+
return $rs.
"</tr>\n";
+
}
+
+
if ( $matches[1] ==
"=" ) {
+
$trigger_table =
3;
+
$rs .=
"<th";
+
} else if ( $matches[1] ==
"" ) {
+
$trigger_table =
2;
+
$rs .=
"<td";
+
}
+
if ( $matches[2] &&
$matches[2] >
1 ) $rs .=
" colspan=\"$matches[2]\"";
+
if ( $matches[3] &&
$matches[3] >
1 ) $rs .=
" rowspan=\"$matches[3]\"";
+
+
return $rs.
">";
+
+
} else if ( $trigger_table ==
1 ) {
+
//Are in table, no cell - but not asked to open new: please close and parse again. ;)
+
$trigger_table =
0;
+
return "</table>\n".wakka2callback
($things);
+
}
// convert HTML thingies
if ($thing ==
"<")
return "<";
@@ -
414,
6 +
475,
7 @@
"\*\*|\'\'|\#\#|\#\%|@@|::c::|\>\>|\<\<|££|¥¥|\+\+|__|<|>|\/\/|".
# Wiki markup
"======|=====|====|===|==|".
# headings
"\n([\t~]+)(-|&|[0-9a-zA-Z]+\))?|".
# indents and lists
+
"\|[^\|]*?\|(?:\n)?|".
# Simple Tables
"\{\{.*?\}\}|".
# action
"\b[A-ZÄÖÜ][A-Za-zÄÖÜßäöü]+[:](?![=_])\S*\b|".
# InterWiki link
"\b([A-ZÄÖÜ]+[a-zßäöü]+[A-Z0-9ÄÖÜ][A-Za-z0-9ÄÖÜßäöü]*)\b|".
# CamelWords
Save as simpletables_css.patch in ./css/ and apply from there (or do it manually).
--- wikka.css.orig 2006-06-14 18:48:36.000000000 +0200
+++ wikka.css 2006-06-14 18:54:27.000000000 +0200
@@ -446,6 +446,11 @@
border-spacing: 0;
}
+table.wikka th {
+ border: 1px solid #CCC;
+ padding: .1em .25em;
+}
+
table.wikka td {
border: 1px solid #CCC;
padding: .1em .25em;
@@ -600,4 +605,4 @@
.toolbar .btn-active,
.toolbar .btn-pressed { border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; }
.toolbar .btn-pressed { background: ButtonHighlight; }
-.editornamecss { background-color:#CCCCFF; font-size: 18px; padding: 0 10px; }
\ No newline at end of file
+.editornamecss { background-color:#CCCCFF; font-size: 18px; padding: 0 10px; }
Please comment / tell me of any suggestions. --TormodHaugen
Edited on 2006-06-21 07:42:48 by DarTar [updating SVN info, syntax description and examples]
Additions:
2006-06-21
Patch committed to the SVN repository - to be included in 1.1.6.3:
I've hacked together a simple table markup for WikkaWiki; it is working it's way from a "layout" table markup to an accessible data table markup.
Currently it supports table header elements (<th>) and table data elements (<td>), cells spanning several columns and/or rows, table summary and caption, scope attributes for headers, table sections (<thead>, <tbody>, <tfoot>).
Example:
||Row 1 Column 1||Row 1 Column 2||Row 1 Column 3||
||Row 2 Column 1||Row 2 Column 2||Row 2 Column 3||
Example:
|?This is a token summary, must be first line in table markup. PS is between single pipes!|
|#h|
|#b|
|#f|
|=|First Column|=|Second Column||
- An optional caption for the table can be put behind a exclamation mark'ed delimiter (|!|) and a normal delimiter. Needs to be alone on the line!
- Optional row and col scope attributes for headers can be added as |=r| and |=c|.
- Optional thead, tbody and tfoot sections are generated by adding on a separate line |#h|, |#b|, |#f|
- th scope attribute Done.
- thead/tbody/tfoot Done.
Deletions:
2006-06-20
This patch has been committed to the SVN repository and will be included in 1.1.6.3:
I've hacked together a simple table markup for WikkaWiki; it is working it's way from a "layout" table markup to a data table markup.
Currently it supports table header elements (<th>) and table data elements (<td>), cells spanning several columns and/or rows, table summary and caption.
Example (is not in use, cannot be demonstrated here):
||Row 1 Column 1||Row 1 Column 2||Row 1 Column 3||
||Row 2 Column 1||Row 2 Column 2||Row 2 Column 3||
Example (is not in use, cannot be demonstrated here):
|?This is a token summary, must be first line in table markup. PS is between single pipes!|
- A caption for the table can be put behind a exclamation mark'ed delimiter (|!|) and a normal delimiter. Needs to be alone on the line!
Edited on 2006-06-20 13:14:22 by DarTar [updating SVN info]
Additions:
2006-06-20
Deletions:
2006-06-16
Edited on 2006-06-16 07:03:23 by DarTar [patch committed to SVN repository - thanks!]
Additions:
See also
SVN
2006-06-16
This patch has been committed to the SVN repository and will be included in
1.1.6.3:
Patched files:
Deletions:
See also
Edited on 2006-06-15 13:45:20 by TormodHaugen
No differences.
Edited on 2006-06-15 09:33:19 by TormodHaugen [Added links to patches and link to testground.]
Additions:
Test at
Patches for download
It seems as if there might be some trouble with grabbing and patching the code; these files are tested against the 1.1.6.2 download and should work:
Edited on 2006-06-14 15:21:02 by TormodHaugen [updated functionality. now for 1.1.6.2!]
Additions:
I've hacked together a simple table markup for WikkaWiki; it is working it's way from a "layout" table markup to a data table markup.
Currently it supports table header elements (<th>) and table data elements (<td>), cells spanning several columns and/or rows, table summary and caption.
Basic Usage
Example (is not in use, cannot be demonstrated here):
||Row 1 Column 1||Row 1 Column 2||Row 1 Column 3||
||Row 2 Column 1||Row 2 Column 2||Row 2 Column 3||
The delimiter is two pipes (||).
- Use the delimiter to start a new table, row and/or cell.
- The current row is ended with a delimiter at the end of a line.
- The table is ended by starting the next line with anything else than a new delimiter after ending a row.
"Advanced" Usage
Example (is not in use, cannot be demonstrated here):
|?This is a token summary, must be first line in table markup. PS is between single pipes!|
|!|The Caption||
|=|First Column|=|Second Column||
||First datacell||Second Datacell||
|2|A datacell spanning two columns||
|,2|A datacell spanning two rows||A cell on the right||
||Another cell on the right (due to previous rowspan'd cell)||
Enhanced features are enabled by putting modifiers between the pipes.
- A caption for the table can be put behind a exclamation mark'ed delimiter (|!|) and a normal delimiter. Needs to be alone on the line!
- A summary (for accessability) can be given in a delimiter started by a question mark (|?Summary|). Needs to be alone on the line, and first in the markup!
- Each row must (still) be ended by a basic (or any, actually) delimiter.
Wanted
I want input on bugs/issues - and on wanted functionality / suggestion on the markup.
- better delimiters? Please advice.
- header cells Done.
- col/rowspan Done.
- caption Done.
- summary Done.
Patches are for Wikka Wakka Wiki 1.1.6.2. Should be easy to implement manually (or fuzzy) for other versions.
Save as simpletables.patch in ./formatters/ and apply from there (or do it manually).
wakka.php.orig 2006-06-14 18:42:49.000000000 +0200
+ wakka.php 2006-06-14 18:42:55.000000000 +0200
-26,6 +26,7
static $indentClosers = array();
static $newIndentSpace= array();
static $br = 1;
static $trigger_bold = 0;
static $trigger_italic = 0;
static $trigger_underline = 0;
-48,6 +49,9
-59,11 +63,68
+ $trigger_bold = $trigger_center = $trigger_floatl = $trigger_inserted = $trigger_deleted = $trigger_italic = $trigger_keys = $trigger_table = 0;
+ if ( preg_match("/^\|(\?)(.*?)?\|(\n)?$/", $thing, $matches) ) {
+ if ( $trigger_table
0 )
+ $rs = "<table class=\"wikka\">\n";
+ if ($matches[1] "!") {
+ $trigger_table = 4;
+ return $rs."<caption>";
+ } else {
+ $rs .= "<tr>";
+ }
+ else if ( $trigger_table
1 ) {
+ if ($matches[1] "!") {
+ $trigger_table = 4;
+ return "<caption>";
+ } else {
+ $rs = "<tr>";
+ }
+ else if ( $trigger_table
4 ) {
+ return "</caption>\n";
-414,6 +475,7
"\*\*|\'\'|\#\#|\#\%|
|
|\>\>|\<\<|
||\+\+||<|>|\/\/|". # Wiki markup
Save as simpletables_css.patch in ./css/ and apply from there (or do it manually).
wikka.css.orig 2006-06-14 18:48:36.000000000 +0200
+ wikka.css 2006-06-14 18:54:27.000000000 +0200
-446,6 +446,11
border-spacing: 0;
+ border: 1px solid #CCC;
table.wikka td {
border: 1px solid #CCC;
padding: .1em .25em;
-600,4 +605,4
Deletions:
Patches for 1.1.6.2 (beta):
I've hacked together a simple table markup for WikkaWiki; it is working it's way from a "layout" table markup to a data table markup.
Currently it supports table header elements (<th>) and table data elements (<td>), and also cells spaning several columns and/or rows.
Usage
Basic delimiter is two pipes (||). This will start a normal datacell.
Enhanced features are enabled by putting modifiers between the pipes:
Each row must be ended by a basic (or any, actually) delimiter.
A table is ended when no cell is open and there is any data except a delimiter at the start of the line - or at the end of the page's data.
- better delimiters? please advice.
- caption (currently planned: |c| or maybe |!|) - in testing
- summary (currently planned: |s| or maybe |?|) summary isn't an element until XHTML 2.0 :/
- close row at end of line (if people does not want to be able to spread a cell over multiple lines).
- fix known issue (different behavior if previous todo is implemented or not).
Patches are for Wikka Wakka Wiki 1.1.6.1
First comes new and improved patch for wakka.php and wikka.css - then comes old patches for the same. Revert the latter pair, install the former pair. :)
Below is the new patch containing headers and col/rowspan. Remember to remove the old patch (it is at the bottom of the page):
wakka.php.orig 2006-05-18 12:56:27.000000000 +0200
+ wakka.php 2006-06-04 23:20:56.000000000 +0200
-28,12 +28,16
static $trigger_strike = 0;
static $trigger_inserted = 0;
static $trigger_center = 0;
static $trigger_l = array(-1, 0, 0, 0, 0, 0);
global $wakka;
-45,11 +49,41
+ $trigger_bold = $trigger_center = $trigger_table = $trigger_floatl = $trigger_inserted = $trigger_deleted = $trigger_italic = $trigger_keys = 0;
+ if ( preg_match("/^\|(=)?(\d*)?(?:,)?(\d*)?\|(\n)?$/", $thing, $matches) ) {
+ First catch is header, second is colspan, third is rowspan, fourth is linebreak.
+ if ( $trigger_table 0 ) $rs = "<table class=\"wikka\">\n<tr>";
+ else if ( $trigger_table
1 ) $rs = "<tr>";
-371,6 +405,7
"\n". # new line
-382,4 +417,4
echo ($text);
wakka2callback('closetags');
-?>
+?>
Patch for ./css/wikka.css is here, work it as above (put the file in the css directory).
wikka.css.orig 2006-05-18 13:05:30.000000000 +0200
+ wikka.css 2006-06-04 23:58:44.000000000 +0200
-412,3 +412,18
color: #993333;
text-decoration: none;
+/* SimpleTable style */
+table.wikka {
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ border-spacing: 0;
+table.wikka td {
+ border: 1px solid #ccc;
+ border: 1px solid #ccc;
OLD patch for ./formatters/wakka.php is here, this is the one to revert:
wakka.php.orig 2006-05-18 12:56:27.000000000 +0200
+ wakka.php 2006-05-15 21:29:54.000000000 +0200
-28,12 +28,15
static $trigger_strike = 0;
static $trigger_inserted = 0;
static $trigger_center = 0;
static $trigger_l = array(-1, 0, 0, 0, 0, 0);
global $wakka;
+ if (1 < $trigger_table) echo ('</td></tr>');
-45,11 +48,41
+ $trigger_bold = $trigger_center = $trigger_table = $trigger_floatl = $trigger_inserted = $trigger_deleted = $trigger_italic = $trigger_keys = 0;
+ if ($trigger_table 0)
+ {
+ We're not in a table, check to see if we want to create one
+ if (preg_match("/\n\|\|/s", $thing, $matches)) {
+ return "<br />\n<table class=\"wikka\">\n<tr><td>";
+ else if ($trigger_table
1)
+ {
+ We're in a table, but not in a cell. Create new row+cell? or end table?
+ if (preg_match("/\|\|/s", $thing, $matches))
+ return "<tr><td>";
+ else if ($thing != "")
+ $trigger_table = 0;
+ return "</table>\n".wakka2callback($things);
+ else if ($trigger_table 2)
+ {
+
We're in a cell, check for newline if we need a new row + last ended.
+ if (preg_match("/\n\|\|/s", $thing, $matches))
+ return "</td></tr>\n<tr><td>";
-70,6 +103,17
return ("<div class=\"clear\"> </div>\n");
+ end cell + row.
+ else if (preg_match("/\|\|\n/s", $thing, $matches))
+ {
+ $trigger_table = 1;
+ return "</td></tr>\n";
+ end cell + start cell. all other stuff handeled before.
+ else if ($thing
"||")
+ {
+ return "</td><td>";
keyboard
else if ($thing "")
-371,6 +415,7
+ "\n\|\||\|\|\n|\|\||". # Simple Tables
"\n". # new line
-382,4 +427,4
echo ($text);
wakka2callback('closetags');
-?>
+?>
Old patch for ./css/wikka.css is here, remove this one if you didn't make the css yourself.
wikka.css.orig 2006-05-18 13:05:30.000000000 +0200
+ wikka.css 2006-05-05 00:18:36.000000000 +0200
-412,3 +412,14
color: #993333;
text-decoration: none;
+/* SimpleTable style */
+table.wikka {
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ border-spacing: 0;
+table.wikka td {
+ border: 1px solid #ccc;
Edited on 2006-06-06 15:37:07 by TormodHaugen [updated todos]
Additions:
- caption (currently planned: |c| or maybe |!|) - in testing
- summary (currently planned: |s| or maybe |?|) summary isn't an element until XHTML 2.0 :/
Deletions:
- caption (currently planned: |c| or maybe |!|)
- summary (currently planned: |s| or maybe |?|)
Edited on 2006-06-05 05:49:30 by TormodHaugen [minor changes]
Additions:
See also
Patches for 1.1.6.2 (beta):
A table is ended when no cell is open and there is any data except a delimiter at the start of the line - or at the end of the page's data.
- better delimiters? please advice.
- caption (currently planned: |c| or maybe |!|)
- summary (currently planned: |s| or maybe |?|)
Patches are for Wikka Wakka Wiki 1.1.6.1
Deletions:
See also
WikkaTables
TableAction
Test at
my test wiki:SandBox∞
Patches for 1.1.6.2 (beta):
http://temp.tormodh.net/simpletables_beta.patch∞
http://temp.tormodh.net/simpletables_css_beta.patch∞
A table is ended when no cell is open and there is any data except a delimiter at the start of the line, or at the end of the page's data.
- better delimiters. please advice.
- caption (currently planned: |c|)
- summary (currently planned: |s|)
Patches is for Wikka Wakka Wiki 1.1.6.1
Oldest known version of this page was edited on 2006-06-05 03:34:41 by TormodHaugen [initial store]
Page view:
Simple Table markup for Wikka
I've hacked together a simple table markup for WikkaWiki; it is working it's way from a "layout" table markup to a data table markup.
Currently it supports table header elements (<th>) and table data elements (<td>), and also cells spaning several columns and/or rows.
Usage
Basic delimiter is two pipes (||). This will start a normal datacell.
Enhanced features are enabled by putting modifiers between the pipes:
- A header cell is started with a equals sign (|=|).
- A cell span is started with numbers seperated by a comma. (|2| = colspan="2", |2,2| = col+rowspan ="2" each, |,2| = rowspan="2" only).
Each row must be ended by a basic (or any, actually) delimiter.
A table is ended when no cell is open and there is any data except a delimiter at the start of the line, or at the end of the page's data.
Known Issues
Ending the table with a || delimiter without a newline adds another cell/column. (ie: if there is no more content after the table, or if there is a space after the delimiter).
TODO
- better delimiters. please advice.
- caption (currently planned: |c|)
- summary (currently planned: |s|)
- close row at end of line (if people does not want to be able to spread a cell over multiple lines).
- fix known issue (different behavior if previous todo is implemented or not).
Code
Patches is for Wikka Wakka Wiki 1.1.6.1
First comes new and improved patch for wakka.php and wikka.css - then comes old patches for the same. Revert the latter pair, install the former pair. :)
To pach a file under Linux; put the patch file in the same directory as the file itself and run with the command:
patch -p0 -l < patch_name.patch
Revert (uninstall ;)) with the command:
patch -p0 -l -R < patch_name.patch
Below is the new patch containing headers and col/rowspan. Remember to remove the old patch (it is at the bottom of the page):
--- wakka.php.orig
2006-
05-
18 12:
56:
27.
000000000 +
0200
+++ wakka.php
2006-
06-
04 23:
20:
56.
000000000 +
0200
@@ -
28,
12 +
28,
16 @@
static $trigger_strike =
0;
static $trigger_inserted =
0;
static $trigger_center =
0;
+
static $trigger_table =
0;
static $trigger_l =
array(-
1,
0,
0,
0,
0,
0);
global $wakka;
if ((!
is_array($things)) &&
($things ==
'closetags'))
{
+
if (2 <
$trigger_table) echo ('</th></tr>');
+
else if (1 <
$trigger_table) echo ('</td></tr>');
+
if (0 <
$trigger_table) echo ('</table>');
if ($trigger_strike %
2) echo ('</span>');
if ($trigger_notes %
2) echo ('</span>');
if ($trigger_inserted %
2) echo ('</span>');
@@ -
45,
11 +
49,
41 @@
if ($trigger_bold %
2) echo('</strong>');
for ($i =
1;
$i<=
5;
$i ++
)
if ($trigger_l[$i] %
2) echo ("</h$i>");
-
$trigger_bold =
$trigger_center =
$trigger_floatl =
$trigger_inserted =
$trigger_deleted =
$trigger_italic =
$trigger_keys =
0;
+
$trigger_bold =
$trigger_center =
$trigger_table =
$trigger_floatl =
$trigger_inserted =
$trigger_deleted =
$trigger_italic =
$trigger_keys =
0;
$trigger_l =
array(-
1,
0,
0,
0,
0,
0);
$trigger_monospace =
$trigger_notes =
$trigger_strike =
$trigger_underline =
0;
return;
}
+
// table. trigger means: 0==no table, 1==in table no cell, 2==in table data cell, 3==in table header cell
+
if ( preg_match("/^\|(=)?(\d*)?(?:,)?(\d*)?\|(\n)?$/",
$thing,
$matches) ) {
+
//First catch is header, second is colspan, third is rowspan, fourth is linebreak.
+
if ( $trigger_table ==
0 ) $rs =
"<table class=\"wikka\">\n<tr>";
+
else if ( $trigger_table ==
1 ) $rs =
"<tr>";
+
else if ( $trigger_table ==
2 ) $rs =
"</td>";
+
else if ( $trigger_table ==
3 ) $rs =
"</th>";
+
+
if ( $trigger_table >
1 &&
$matches[4] ==
"\n") {
+
$trigger_table =
1;
+
return $rs.
"</tr>\n";
+
}
+
+
if ( $matches[1] ==
"=" ) {
+
$trigger_table =
3;
+
$rs .=
"<th";
+
} else if ( $matches[1] ==
"" ) {
+
$trigger_table =
2;
+
$rs .=
"<td";
+
}
+
if ( $matches[2] &&
$matches[2] >
1 ) $rs .=
" colspan=\"$matches[2]\"";
+
if ( $matches[3] &&
$matches[3] >
1 ) $rs .=
" rowspan=\"$matches[3]\"";
+
+
return $rs.
">";
+
+
} else if ( $trigger_table ==
1 ) {
+
//Are in table, no cell - but not asked to open new: please close and parse again. ;)
+
$trigger_table =
0;
+
return "</table>\n".wakka2callback
($things);
+
}
// convert HTML thingies
if ($thing ==
"<")
return "<";
@@ -
371,
6 +
405,
7 @@
"======|=====|====|===|==|".
# headings
"\n([\t~]+)(-|&|[0-9a-zA-Z]+\))?|".
# indents and lists
"\{\{.*?\}\}|".
# action
+
"\|[^\|]*?\|(?:\n)?|".
# Simple Tables
"\b[A-ZÄÖÜ][A-Za-zÄÖÜßäöü]+[:](?![=_])\S*\b|".
# InterWiki link
"\b([A-ZÄÖÜ]+[a-zßäöü]+[A-Z0-9ÄÖÜ][A-Za-z0-9ÄÖÜßäöü]*)\b|".
# CamelWords
"\n".
# new line
@@ -
382,
4 +
417,
4 @@
echo ($text);
wakka2callback
('closetags');
-
?>
\ No newline at
end of
file
+
?>
Patch for ./css/wikka.css is here, work it as above (put the file in the css directory).
--- wikka.css.orig 2006-05-18 13:05:30.000000000 +0200
+++ wikka.css 2006-06-04 23:58:44.000000000 +0200
@@ -412,3 +412,18 @@
color: #993333;
text-decoration: none;
}
+
+/* SimpleTable style */
+table.wikka {
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+table.wikka td {
+ border: 1px solid #ccc;
+ padding: .1em .25em;
+}
+table.wikka th {
+ border: 1px solid #ccc;
+ padding: .1em .25em;
+}
OLD patch for ./formatters/wakka.php is here, this is the one to revert:
--- wakka.php.orig
2006-
05-
18 12:
56:
27.
000000000 +
0200
+++ wakka.php
2006-
05-
15 21:
29:
54.
000000000 +
0200
@@ -
28,
12 +
28,
15 @@
static $trigger_strike =
0;
static $trigger_inserted =
0;
static $trigger_center =
0;
+
static $trigger_table =
0;
static $trigger_l =
array(-
1,
0,
0,
0,
0,
0);
global $wakka;
if ((!
is_array($things)) &&
($things ==
'closetags'))
{
+
if (1 <
$trigger_table) echo ('</td></tr>');
+
if (0 <
$trigger_table) echo ('</table>');
if ($trigger_strike %
2) echo ('</span>');
if ($trigger_notes %
2) echo ('</span>');
if ($trigger_inserted %
2) echo ('</span>');
@@ -
45,
11 +
48,
41 @@
if ($trigger_bold %
2) echo('</strong>');
for ($i =
1;
$i<=
5;
$i ++
)
if ($trigger_l[$i] %
2) echo ("</h$i>");
-
$trigger_bold =
$trigger_center =
$trigger_floatl =
$trigger_inserted =
$trigger_deleted =
$trigger_italic =
$trigger_keys =
0;
+
$trigger_bold =
$trigger_center =
$trigger_table =
$trigger_floatl =
$trigger_inserted =
$trigger_deleted =
$trigger_italic =
$trigger_keys =
0;
$trigger_l =
array(-
1,
0,
0,
0,
0,
0);
$trigger_monospace =
$trigger_notes =
$trigger_strike =
$trigger_underline =
0;
return;
}
+
if ($trigger_table ==
0)
+
{
+
//We're not in a table, check to see if we want to create one
+
if (preg_match("/\n\|\|/s",
$thing,
$matches)) {
+
$trigger_table =
2;
+
return "<br />\n<table class=\"wikka\">\n<tr><td>";
+
}
+
}
+
else if ($trigger_table ==
1)
+
{
+
//We're in a table, but not in a cell. Create new row+cell? or end table?
+
if (preg_match("/\|\|/s",
$thing,
$matches))
+
{
+
$trigger_table =
2;
+
return "<tr><td>";
+
}
+
else if ($thing !=
"")
+
{
+
$trigger_table =
0;
+
return "</table>\n".wakka2callback
($things);
+
}
+
}
+
else if ($trigger_table ==
2)
+
{
+
//We're in a cell, check for newline if we need a new row + last ended.
+
if (preg_match("/\n\|\|/s",
$thing,
$matches))
+
{
+
return "</td></tr>\n<tr><td>";
+
}
+
}
// convert HTML thingies
if ($thing ==
"<")
return "<";
@@ -
70,
6 +
103,
17 @@
{
return ("<div class=\"clear\"> </div>\n");
}
+
// end cell + row.
+
else if (preg_match("/\|\|\n/s",
$thing,
$matches))
+
{
+
$trigger_table =
1;
+
return "</td></tr>\n";
+
}
+
// end cell + start cell. all other stuff handeled before.
+
else if ($thing ==
"||")
+
{
+
return "</td><td>";
+
}
// keyboard
else if ($thing ==
"#%")
{
@@ -
371,
6 +
415,
7 @@
"======|=====|====|===|==|".
# headings
"\n([\t~]+)(-|&|[0-9a-zA-Z]+\))?|".
# indents and lists
"\{\{.*?\}\}|".
# action
+
"\n\|\||\|\|\n|\|\||".
# Simple Tables
"\b[A-ZÄÖÜ][A-Za-zÄÖÜßäöü]+[:](?![=_])\S