Additions:
Some text...
Additions:
Bullets:
~- item one
~~- subitem one
~~- subitem two
~- item two
~~- subitem three
~- item three
Additions:
""~- one""
""~- two""
""~~1) three""
""~~1) four""
""~- five""
""~1) six""
~- one
~- two
~~1) three
~~1) four
~- five
~1) six
~- one
~- two
~~1) three
~~1) four
~- five
~1) six
Deletions:
"" - one""
"" - two""
"" 1) three""
"" 1) four""
"" - five""
"" 1) six""
- one
- two
1) three
1) four
- five
1) six
- one
- two
1) three
1) four
- five
1) six
Additions:
Markup:
"" - one""
"" - two""
"" 1) three""
"" 1) four""
"" - five""
"" 1) six""
Rendered:
- one
- two
1) three
1) four
- five
1) six
Generated
%%(wiki2html)
- one
- two
1) three
1) four
- five
1) six
%%
Deletions:
|| Does this work||or does it not || Maybe this would work ||
||I would like the above to be right aligned||I would like the above to be left aligned||I would like the above to be centered||
OK, it didn't work! I think this kind of alignment is easy and perfect, why not implement it?
It should work with spaces or tabs.
||{background-color:red}1x1||{background-color:#333;color:blue}1x1||(x:2){background-color:pink}2x1||
?|Table Elements||
|| XHTML Elements||Delimiter||Notes
||<table>|| |!| ||Optional, only useful for adding attributes. Must be first in table markup if used. Should be on a line by itself.||
||<caption>|| |?| ||
|?|Caption||
|=|Name|=|Number||
||Me||12||
||Someone||15||
''fgrg''
----
||faf||faf||faefa||
||fadf||fdagagahaha||||
|=|Heading 1||Content 11||Content 12||
|=|Heading 2||Content 21||Content 22||
Perhaps it should be mentioned, that headings must be preceded by ""|=|"" and followed by ""||"" if the next cell should countain data ...
||Content 11||Content 12|=|Heading 1||
|=|Heading 2||Content 21||Content 22||
----
""||(x:2;y:2)2x2||(x:2)2x1||(y:2)1x2||""
""||(y:2)1x2||1x1||""
""||1x1||1x1||(x:2)2x1||""
||(x:2;y:2)2x2||(x:2)2x1||(y:2)1x2||
||(y:2)1x2||1x1||
||1x1||1x1||(x:2)2x1||
||##Mono##||[[WikiHome Forced]]|| {{wikkaversion}}|| **##Bold mono##** ||
||//Italics//||===Heading===||++Strike++|| {{image url="http://wiki.tormodh.net/images/xml.png" alt="xml" title="xml feed"}}||
||""SandBox escaped""||""embedded<sup>html</sup>""||@@center@@||{{color c="red" text="testme"}}||
=== Adding some styling to the above ===
~&Oh, maybe we should add top and bottom margin to table CSS...
~~&Try removing the space before action markup after applying the regex hack. -- DT
~~~&Did it, works nice. Just copy and paste the RE you mailed me. -- TH
""|!|{float:right}||""
""||(x:2;y:2){background-color:pink}2x2||(x:2){background-color:lightblue}2x1||(y:2){background-color:lightyellow}1x2||""
""||(y:2){background-color:lightyellow}1x2||{background-color:#333;color:white}1x1||""
""||{background-color:lightblue}1x1||{background-color:#333;color:white}1x1||(x:2){background-color:pink}2x1||""
""|!|(i:Hello;u:What a gorgeous table!){float:left}""
""|?|Ohi, ohi, ohi, ohi!||""
""|[|""
""|=|(x:4){color:#000;font-size:150%;font-style:italic;font-family:Hoefler Text, Georgia;font-weight:normal;line-height:150%}Ephemere Quibus||""
""|#|""
""|=|(x:2)First things first|=|(x:2)Second things second||""
""||##Mono##||A [[WikiHome forced link]] and an escaped ""CamelCase"" link|| {{wikkaversion}} (action generated content)|| **##Bold mono##** ||""
""||//Italics//||===Heading===||++Strike++|| {{image url="http://wiki.tormodh.net/images/xml.png" alt="xml" title="xml feed"}}||""
""||%%echo "Even some code!"%%||""embedded<sup>html</sup>""||>>Hello>>||(i:moah){background:#000;text-align:center;color:white}testme||""
|!|{float:right}||
||(x:2;y:2){background-color:pink}2x2||(x:2){background-color:lightblue}2x1||(y:2){background-color:lightyellow}1x2||
||(y:2){background-color:lightyellow}1x2||{background-color:#333;color:white}1x1||
||{background-color:lightblue}1x1||{background-color:#333;color:white}1x1||(x:2){background-color:pink}2x1||
|!|(i:Hello;u:What a gorgeous table!){float:left}
|?|Ohi, ohi, ohi, ohi!||
|[|
|=|(x:4){color:#000;font-size:150%;font-style:italic;font-family:Hoefler Text, Georgia;font-weight:normal;line-height:150%}Ephemere Quibus||
|#|
|=|(x:2)First things first|=|(x:2)Second things second||
||##Mono##||A [[WikiHome forced link]] and an escaped ""CamelCase"" link|| {{wikkaversion}} (action generated content)|| **##Bold mono##** ||
||//Italics//||===Heading===||++Strike++|| {{image url="http://wiki.tormodh.net/images/xml.png" alt="xml" title="xml feed"}}||
||%%echo "Even some code!"%%||""embedded<sup>html</sup>""||>>Hello>>||(i:moah){background:#000;text-align:center;color:white}testme||
::c::
----
|!|(u:The Summary)
|?|The Caption||
|=|Name|=|Number|=|(x:2)Span||
||John Smith||1||This||That||
||Jane Doe||2||That||This||
----
|!|(u:The Summary)
|?|The Caption||
|=|(o:row)Name||John Smith||Jane Doe||
|=|(o:row)Number||1||2||
|=|(o:row;y:2)Span||This||That||
||That||This||
----
|!|(u:The number of employees and the foundation year of some imaginary companies.)
|?|Table 1: Company data||
|||=|(o:col)Employees|=|(o:col)Founded||
|=|(o:row)ACME Inc||1000||1947||
|=|(o:row)XYZ Corp||2000||1973||
----
|!|(u:A table with summary, caption, thead, tfoot and two tbody)||
|?|thead, tfoot, tbody, tbody||
|[|
|=|Name|=|Place|=|Telephone||
|]|
|=|Name|=|Place|=|Telephone||
|#|
||John Smith||New York||555-1234||
||Jane Smith||Loa Angeles||555-2345||
|#|
||John Doe||Unknown||Unknown||
||Jane Doe||Unknown||Unknown||
==Sample from the HTML 4.01 document about tables==
let's see...
~&The following is tricky, indeed. wondering if we can't do any better. -- DT
~~&Trouble now is closing parenthesis in the summary - ends the parsing of attributes. Will need some thinking.
""|!|(u:This table charts the number of cups of coffee consumed by each senator, the type of coffee (decaf or regular), and whether taken with sugar.;i:JW_table;t:http://www.w3.org/TR/html401/struct/tables.html#edef-TABLE)""
""|?|Cups of coffee consumed by each senator||""
""|[|""
""|=|(o:col)Name|=|(o:col)Cups|=|(o:col)Type of Coffee|=|(o:col)Sugar?||""
""|#|""
""||T. Sexton||(s:background-color:#aaa;text-align:right)10||(t:he likes it too much!)Espresso||No||""
""||J. Dinnen||(s:background-color:#aaa;text-align:right)5||(t:more sensible)Decaf||Yes||""
""||A. Soria||(x:3)Not avaliable||""
|!|(u:This table charts the number of cups of coffee consumed by each senator, the type of coffee (decaf or regular), and whether taken with sugar.;i:JW_table;t:http://www.w3.org/TR/html401/struct/tables.html#edef-TABLE)
|?|Cups of coffee consumed by each senator||
|[|
|=|(o:col)Name|=|(o:col)Cups|=|(o:col)Type of Coffee|=|(o:col)Sugar?||
|#|
||T. Sexton||(s:background-color:#aaa;text-align:right)10||(t:he likes it too much!)Espresso||No||
||J. Dinnen||(s:background-color:#aaa;text-align:right)5||(t:more sensible)Decaf||Yes||
||A. Soria||(x:3)Not avaliable||
++BTW, I realize now the ? notation for summary is inconsistent: it's an attribute, not an element....); left-over from the previous markup. How about 'u' for summary? Clearly combining ? with other attributes for the table element does not work now... should give you something to look at; also note there's a : //inside// the table's title attribute.++
Now if we could have a markup for cols and colgroups as well... :)
~&Please write an example of how you would mark up <colgroup><col/><col/></colgroup><colgroup span="2"/><col/><col span="2"/>
~~&21:08 <+JavaWoman> <col><colgroup><col><col span="2"/></colgroup><colgroup span="2"></colgroup>
~~&21:09 <+JavaWoman> assuming - (dash) for col and _ (underscore for colgroup): on three lines:
~~&21:09 <+JavaWoman> ""|-|""
~~&21:09 <+JavaWoman> ""|_||-||-(p=2)|""
~~&21:10 <+JavaWoman> ""|_(p=2)|""
Great work so far!
- JavaWoman
----
""|?|just cols and colgroups||""
""|-|""
""|_||-||-|(p:2)||""
""|_|(p:2)||""
|?|just cols and colgroups||
|-|
|_||-||-|(p:2)||
|_|(p:2)||
----
There's a table with JavaWoman's markup between the two <hr/> lines above. Except some added ''""||""'' since colgroups needs be closed.
----
Hi Tormod - I've committed the last patch to trunk: http://wush.net/trac/wikka/changeset/160
Excellent work.
The only two points that deserve IMO some further thoughts are the following:
~-**style attribute** --- Support for the **##style##** attribute is tricky because it opens a lot of ":" which are ambiguous (I guess it could be easily broken by unexperienced users).
~-**readability issues** --- Adding parameters //within// the separators is semantically correct, but makes it very difficult to visually parse a table. Something like: --- **{{color fg="green" text="(current)"}}** ##""|(s:background-color:#aaa;text-align:right;t:he likes it too much!)|Espresso||""## --- is IMO much less readable than --- **{{color fg="red" text="(modified)"}}** ##""||(s:background-color:#aaa;text-align:right;t:he likes it too much!)Espresso||""## --- I'd like to have your and others' (Marjolein?) thoughts about the possibility of moving the parameters //after// the separator, as in this example. I know this would require rewriting again the formatter (apologies!) and limit the use of brackets at the beginning of a cell, but maybe this would make the markup less hard to read/learn and avoid a lot of potential errors. As a further argument, think of what might happen the day we'll try to apply parameters to other markup, e.g. to links or floats. --- Wouldn't: --- **{{color fg="red" text="(modified)"}}** ##""[[(t:My title;i:i25)Page This is a page]]""## --- **{{color fg="red" text="(modified)"}}** ##""<<(t:What a nice float;i:i33)1<2 is true or not?<< ""## --- **{{color fg="red" text="(modified)"}}** ##""''(i:i21)I'd like to''""## --- be more readable than: --- **{{color fg="green" text="(current)"}}** ##""[(t:My title;i:i25)[Page This is a page]]""## --- **{{color fg="green" text="(current)"}}** ##""<(t:What a nice float;i:i33)<1<2 is true or not?<< ""## --- **{{color fg="green" text="(current)"}}** ##""'(i:i21)'I'd like to''""## --- ?
Feedback welcome.
-- Dario
~
~~-I agree with the readability aspect of the style attribute - no parsing problem for a machine (REs) but a possible source of errors for humans. The only alternative I see is to separate attribute letter from value with '=' instead of ':' - everywhere, of course. That shouldn't be hard to adapt, I think. (Tormod?) It's especially important if we are going to allow/support this type of markup for other wiki "tags" as well.
~~~& ##(a1=v1;a2=v2)## sounds like a good compromise to me. Tormod? --DT
~~~& I've implemented it here now; not sure if I like the change. --tormodh
~~~~& Tormod, looking at the new version I confess I also liked the previous one (using ##:##) more. I hadn't thought that ##=## would conflict with the header markup. Also, I hadn't realised that using ##=## to introduce attribute values //without doublequotes// could be another potential source of errors for humans. We should either stick to a ##p:a##, CSS-like style (with no doublequotes) or to a ##p="a"##, XML-like style (with doublequotes): a hybrid version like ##p=a## IMO is likely to produce even more confusions. Right now I'm kind of hesitating what is the best option :-| --DT
~~~~~&First, I don't see how or why using = for attribute "assignment" would conflict with heading markup: attributes are withing brackets at the start of a cell (or any wiki markup "element") while headings are content and thus outside the bracketed attributes expression.---Second, yes, it's possible that non-quoted attribute values cause a problem - but **only** if they contain a semicolon or a closing bracket. I see two possible solutions for that: 1) enforce quotes (single or double) - but this greatly increases the bulk of the markup and typing; or 2) use standard escaping if these characters are really needed in an attribute value (except styles, see below), i.e., a backslash: then an attribute separator is a ';' **not** preceded by a '\' and the end of the attributes expression is a ')' **not** preceded by a '\'. Pulling out all attributes and splitting into separate ones then is a matter of standard regex operations. Attribute (letter) "symbols" can be distinguished from CSS properties simply by the fact that there are no CSS properties that have a name consisting of only a single letter, so escaping the ; in this context should not be needed. Other contexts where ')' or ';' are necessary in an attribute value are IMO rare enough that asking users to escape those would not be too much - especially not in return for a very powerful yet simple table markup (and other wiki markup!). --JavaWoman
~~-With respect to having "(attributes)" **inside** the tag markers (just before the content) rather than *between* symbols - well, it's actually so obvious I can't think why none of us thought of that before! ;) Especially since we //already// do something like that for code blocks (however for consistency that markup should be modified a little - if we can do that while maintaining backwards compatibility. I certainly agree it's much more readable, as well as easier to type. I hope that's not too big of a change but I suspect it's mostly a matter of tweaking the REs. Of course **element markers** should remain between markup symbols (making them just "part of" markup symbols, in fact).
~~~&Glad you agree - I'm now looking forward to hear from Tormod... --DT
~~~&Agree. Looking on it now. --tormodh
~~~~& Great! --DT
~~-As far as error trapping is concerned (Tormod's remark in #wikka) I think some basic stuff could be done with another set of flags. For instance, once you've had a thead marker, set a flag and ignore all others since it can occur only once. If you allow colgroup/col only before (implicit) row groups, then at the first rowgroup or table row, set a "no more col(group)s" flag and ignore any that come after. We'd need to draw up a simple set of rules, but this way you can prevent some invalid **output** at least in a relatively simple way.
~~~& Yes, some way to enforce validation and prevent errors sounds great (if this is not too costly in terms of performance) --DT
~~~& Sure. --tormodh
~~-BTW, Dario, just for the sake of not confusing people: I modified your sample code a bit since IDs cannot start with a digit. (There's another thing that could be easily checked; ignore invalid values.)
~~~& Oh, thanks for fixing this! --DT
~~-comments?
~~JavaWoman
~& BTW, Tormod, I do hope you see all this as it's intended: not as criticism, but as support for your great effort! --JavaWoman
end.
Deletions:
||{border-style:none}1x1||{background-color:#333;color:blue}1x1||(x:2){background-color:pink}2x1||
Additions:
||{border-style:none}1x1||{background-color:#333;color:blue}1x1||(x:2){background-color:pink}2x1||
No Differences
Additions:
OK, it didn't work! I think this kind of alignment is easy and perfect, why not implement it?
It should work with spaces or tabs.
Deletions:
|,3|OK, it didn't work! I think this kind of alignment is easy and perfect, why not implement it?
It should work with spaces or tabs.||
Additions:
|,3|OK, it didn't work! I think this kind of alignment is easy and perfect, why not implement it?
Deletions:
|3|OK, it didn't work! I think this kind of alignment is easy and perfect, why not implement it?
Additions:
|3|OK, it didn't work! I think this kind of alignment is easy and perfect, why not implement it?
It should work with spaces or tabs.||
Additions:
||I would like the above to be right aligned||I would like the above to be left aligned||I would like the above to be centered||
Deletions:
||asdasd ads asd asd asd asd sad||sadasdasdasdasda sdasd asd sad sdsad||asdasd ads asd asd asd asd asd ads sd||
Additions:
|| Does this work||or does it not || Maybe this would work ||
||asdasd ads asd asd asd asd sad||sadasdasdasdasda sdasd asd sad sdsad||asdasd ads asd asd asd asd asd ads sd||
No Differences
Additions:
?|Table Elements||
|| XHTML Elements||Delimiter||Notes
||<table>|| |!| ||Optional, only useful for adding attributes. Must be first in table markup if used. Should be on a line by itself.||
||<caption>|| |?| ||
Additions:
||{background-color:red}1x1||{background-color:#333;color:blue}1x1||(x:2){background-color:pink}2x1||
Additions:
||faf||faf||faefa||
||fadf||fdagagahaha||||
Additions:
''fgrg''
No Differences
Additions:
""|!|{float:right}||""
""||(x:2;y:2){background-color:pink}2x2||(x:2){background-color:lightblue}2x1||(y:2){background-color:lightyellow}1x2||""
""||(y:2){background-color:lightyellow}1x2||{background-color:#333;color:white}1x1||""
""||{background-color:lightblue}1x1||{background-color:#333;color:white}1x1||(x:2){background-color:pink}2x1||""
""|!|(i:Hello;u:What a gorgeous table!){float:left}""
""|?|Ohi, ohi, ohi, ohi!||""
""|=|(x:4){color:#000;font-size:150%;font-style:italic;font-family:Hoefler Text, Georgia;font-weight:normal;line-height:150%}Ephemere Quibus||""
""|=|(x:2)First things first|=|(x:2)Second things second||""
""||##Mono##||A [[WikiHome forced link]] and an escaped ""CamelCase"" link|| {{wikkaversion}} (action generated content)|| **##Bold mono##** ||""
""||//Italics//||===Heading===||++Strike++|| {{image url="http://wiki.tormodh.net/images/xml.png" alt="xml" title="xml feed"}}||""
""||%%echo "Even some code!"%%||""embedded<sup>html</sup>""||>>Hello>>||(i:moah){background:#000;text-align:center;color:white}testme||""
Full history for this page cannot be displayed within a single page, click
here to view more.