(anonymous guest) (logged out)

Copyright (C) by the contributors. Some rights reserved, license BY-SA.

Sponsored by the Wiki Symposium and the Nuveon GmbH.

 

Add new attachment

Only authorized users are allowed to upload new attachments.

This page (revision-57) was last changed on 28-Apr-2008 19:53 by Isonomia  

This page was created on 04-Sep-2006 14:21 by Chuck Smith

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 233 added 306 lines
I don't understand why we use a "compromise" for tables that is used by two implementations, when we have two other variants used by five or six implementations? It seems like we're using the variant that two out of thirteen use. Not good.
I suggest doing away with header cells. If users want them, let them use bold within table cells. Or implementations can automatically make the first row into header cells. There's no need for special header markup.
If this is indeed about simple tables, then we don't need a way to adde linebreaks within table cells.
The proposal should say whether other markup within table cells is allowed, disallowed, or implementation-dependent.
-- AlexSchroeder, 2006-12-01
-------
Michele, Alex,
thak's for your feedback. Here's some reasoning why i think it would be useful to have those features, although i could live with it, not having it in the next version of creole:
!Seperate Header Syntax
Without an seperate header syntax it will be hard to control the header display by css, and imho this should be possible. If we don't define it we deprive advanced engines/implementations of the possibility.
''it's not clear what a double pipe ({{{||}}}) at the end of a row means'' - it simply sould not be interpreted, or interpreted as the end..
{{{
||A||B||
}}}
so for example the behavior of JSPWiki is wrong, as it interprets it as a new cell:
||A||B||
This is a frequent error of endusers in JSPWiki: They want to ''close'' a row like this
{{{
||A||B||
|1|2|
}}}
''it's hard to distinguish a cell following an empty one from a header cell'' - it's required to have a space if it sould be a empty cell
{{{
| |previous is an emty cell
|| this cell is rendered as a heading...
}}}
For me the question is if we want to give engines the possibility to render headings differently. After we have decided on this we can discuss what is the best syntax for it (not necessarily double pipes)
Since I am for a seperate header syntax, here's a suggestion: combine [headings] syntax of creole with table syntax of creole. This assumes that you would like to make cells bold that are not headings, but you never would like to use heading syntax other than in heading cells (That's why i don't suggest bold syntax))
{{{
|= Heading1 |= Heading 2 |= Heading3 |
|cell1 | cell2 |cell3 |
}}}
then we could interpret two pipes as emty cell...
Also like DarioTaraborelli shows in his example above, two pipes have a special meaning in other markup which would make it hard to mix markup...
!Line breaks in cells:
You want to split long cells quite frequently in more complicated tables. Sometimes you would like to reduce the width of the table display, because only a certain line is causing the table to be wider than expected. But i guess this is already to advanced.
We don't have dedicated characters for [linebreaks] in creole so far, so we should leave out that syntax in cells, since it introduces inconsistancy. One could rely on the browser to break the lines in cells while resizing the browser frame, or use the native syntax of his wiki to do advanced tables...
!To sum up:
* we either use no heading syntax at all or we define a better way of defining a header cell, since it is hard to distinguish empty cells from headings with the double pipe syntax and it does not mix well with existing markup...
* we do not specify a [linebreak] syntax in cells unless we have discussed linebreak syntax in more detail in creole (currently you define line breaks symply by using return, which is more visual, but produces other problems like this here..)
--[Christoph] 4. Dec 2006
You didn't comment on the idea of using the first row of a cell as headers always -- you just said you prefer a different syntax for headers. Can you elaborate on this? Is it ever useful to have a table without headers, or is it ever useful to have headers in any row but the first?
--AlexSchroeder
Cross tables [Cross_tab|http://en.wikipedia.org/wiki/Cross_tab] should have headers in the first row and first column, imo.
-- JaredWilliams
Yes, that was my idea, where you have ''row'' Headings:
This code in JSPWiki
{{{
|| ||boxers||briefs
||heavy Wiki user|70% |5%
||light Wiki user|25% |35%
||non Wiki user |5% |60%
}}}
creates this display
|| ||boxers||briefs
||heavy Wiki user|70% |5%
||light Wiki user|25% |35%
||non Wiki user |5% |60%
This matrix representation should be possible, since it is a good use case for a tables - present a complex issue in a readable way.
Using tables without headings... I would rather go without heading syntax and help myself with using bold syntax than define the first row of a table always to be the heading...
again, i think this one here would not look that bad at all ;)
{{{
|= |=boxers|=briefs
|=heavy Wiki user |70% |5%
|=light Wiki user |25% |35%
|=non Wiki user |5% |60%
}}}
could you live with something similar to this?
--[Christoph]
I think that in this case I'd be using my "complex table" extension instead of relying on the "simple table" extension. That allows me to use CSS to highlight the various cells in just the way I want.
I do agree that your last example looks not bad, and I could implement something like it. I'm just not convinced that it is a good idea, because it is new (and we should prefer NotNew). Perhaps it should remain ExtensibleByOmission -- not specify table headers at all.
-- AlexSchroeder
Removed special table header syntax and line breaks in tables from [Creole 0.3].
-- [Chuck Smith]
I was wondering, how much of markup is allowed inside table cells exactly? In particular, are links allowed? I have a problem with the pipe symbol in links and images...
-- RadomirDopieralski, 2007-02-05
My opinion is that Creole should only specify which markup //must// be supported in tables (as in other elements), without preventing languages to support also other markup ([[Extensible By Omission]]).
The same stands for links, headings etc.
Radomir, you're right. I didn't think to the pipe in links and images. I'm going to change the priority of rules in PEAR Text_Wiki_Creole. I think support for links (at least) should be required.
-- [[Michele Tomaiuolo]], 2007-02-05
This shows how just discussing things without actually implementing them can lead to missing important details :(
I think that we should explicitly state that pipes between {{{{{{}}} and {{{~}}}}}} tags, and also, if images and links are supported inside tables, between {{{{{{}} }}}and {{{[[]]}}} tags, are not interpreted as cell separators.
-- RadomirDopieralski, 2007-02-05
Just to clarify. I asked to specify a little better how those corner cases should be interpreted. I'm ok with the clarification provided by Christoph (thanks!). Either ways, {{{||}}} or {{{|=}}}, are fine with me. But definitely I'm for specifying a syntax for header cells (at least as a suggested extension).
-- [[Michele Tomaiuolo]], 2007-02-07
The {{{|=}}} looks saner to me -- and consitent with the headings markup. {{{||}}} is used by various engines for headigns, empty cells, cells spanning multiple columns or jus normal cell separators.
-- RadomirDopieralski, 2007-02-08
Should we also add the option to write {{{|= cell header =|}}} to keep it consitent with [[Headings]]?
-- RadomirDopieralski, 2007-02-27
Hmm, yes. What do the others think?
-- ChristophSauer, 2007-02-27
I agree. I already implemented tables this way.
-- [[Michele Tomaiuolo]], 2007-02-27
I disagree. To be consistent, you need to accept {{{|= cell header =}}} (without trailing pipe)
at the end of a row. Then you have to check what follows {{{=}}} if you want to have a table
like
{{{
|= n=1 =|= n=2 =|
| a+b |a^2+b^2+2ab|
}}}
Unnecessarily complicated.
-- [[YvesPiguet]], 2007-02-28
Right, you need to strip the trailing = even when there is no pipe at the end. Thank you for pointing that out.
But I don't really think it is complicated -- it just one "=?" in the cell-parsing regexp, right?
-- [[Radomir Dopieralski]], 2007-Feb-28
It's one more thing to specify, to explain and to test, while it doesn't add anything.
Trailing equals are more justified in heading for compatibility reasons. But I'd accept to
remove them.
-- [[YvesPiguet]], 2007-Feb-28
I don't think you have to explain it to the users -- on the contrary, it would require explanation if they weren't behaving the same as headings. [[MakeTheMachineWorkHarder]], remember?
-- [[Radomir Dopieralski]], 2007-Feb-28
Come on, Radomir! I remember and I strongly agree with you when you "strongly believe
we should lean" to what you call //The second option// in [[Talk.Make The Machine Work Harder]].
You still do, don't you?
-- [[YvesPiguet]], 2007-Feb-28
Sure, I still do. You might want to note that the second option involves consequent rules and the same mechanisms for similar things. This is an example of inconsequency that should be removed. Since the rule for removing equal signs is cheap but increases chances of adopting Creole tremendously -- the "right thing" is to propagate it also to table headings -- to make them similar.
-- RadomirDopieralski, 2007-Mar-01
Rules so fuzzy that you'd rather not explain them. There would be multiple cases which
would be accepted ({{{|=h}}}, {{{|=h=}}}, {{{|=h=|}}}, {{{|=h|}}}), but of course {{{|==h==|}}} wouldn't
work. If you assume "basic computer literacy" from your users, they won't find that your
rules are "clear".
Anyway, most if not all of them will see the difference between block headings
(separate paragraphs) and table headings (shortcut to format a cell, more or less the same
as {{{|**}}}). If they see that {{{|=foo=|}}} displays a bold cell and can't find any explanation, they
might as well conclude that {{{=}}} is for bold face. Or wonder about the difference between
four different constructs.
If I'm the only one here to prefer simple rules I'd be ready to enumerate, then obviously I'd better
stop, it's hopeless.
-- [[YvesPiguet]], 2007-Mar-1
Rules so obvious that you don't have to explain them. They are not fuzzy -- they say "question marks are stripped from headings". I do assume basic computer literacy from my users -- for example, I expect them to find the key with letter "k" on it in less than 20 seconds of searching. Trying to create markup for totally inexperienced people is doomed to failure.
Most of them will be happy using {{{|**foo**|}}} and won't see any difference. {{{|=foo=|}}} doesn't have to display a bold cell. And people don't immediately jump to conclusions like you describe -- it just doesn't work like that.
I know that finding problems and dealing with them is important. But trying out all possibilities and assuming that "users might do that" is not the right way to find the problems. The right way is to observe users and see what they are really having problems with. We can do that to some extent by just observing ourselves or our friend wikizens, but those are obviously experienced users. We can try to "imagine" an inexperienced user and guess what he will have problems -- by induction from our experiences with inexperienced users -- but this will bring bad judgments and false positives. We can finally ask some inexperienced users to use Creole and look at what they have problems with -- that's what I'm trying to do in [[TheStudentExperiment]] and on several wikis I have access to.
-- [[Radomir Dopieralski]], 2007-Mar-01
Hi, I tried to run the PHP version of creole parser and after much heartache and swearing at yet another unfathomable bit of code it would be easier to write from scratch than use .... I finally got something displaying (how I don't know ...) and whilst most of it is 'acceptable' as output, the tables were frankly pathetic.
The result (after I fixed a minor bug in the parser) with my default browser settings (mozilla) was to crowd the cells with no border into a small huddle in the corner of the page, as if they were a crowd of timid chicks.
After a bit of hassle I put on a style sheet with a border, but still the first words stuck to the table sides like swatted flies.
Having said that, the actual syntax of a table is far far better than wikipedia. I've never yet managed to produce a table there without finding an example to work from.
Here's a few "must haves"
1. Borders on/off
2. Alignment left/centre
3. Cell padding (distance between borders and first character)
4. Minimum cell size.
-- [[Isonomia]] 2007-Apr-??
Just read through the comments and at first I thought {{{|=}}} was a good idea ... until I remembered I never use the <th> tag - why would I?. So I went to look to see what <th> gives you that <td> does not and to be honest I couldn't see anything in the list of attributes. **So as far as I can see any difference between a header and a normal row should have nothing to do with creole ... is is afterall an issue of //implementation// rather than specification about tables**
Let me be clearer. If a user wishes to have a table, then the specification should give them the tools to create that style in the first row: e.g.
{{{
| **First item** | **of a bold** | **centred table**
So I went and looked at the table specification in HTML, and this is the syntax I'm (kind of) suggesting for **every** cell:-
Syntax:
<cell> = <wiki-Text>
<table> = <first_row>{<uline><other_row>}*<uline>
<first_row> = (<table_start>%<row_start>%<cell_start>)<SPACE><cell>{<cell_start><SPACE><cell>{<~><uline>}*}*<uline>
<other_row> = (<row_start>%<cell_start>)<SPACE><cell>{<cell_start><SPACE><cell>{<~><uline>}*}*<uline>
<cell_start> = <|><cell_switches>
<row_start> = <|=><row_switches>
<table_start> = <||><table_switchs>
<cell_switches> = {'<'|'I'|'>'}{'v'|'-'|'^'}{'*'|'/'}
<row_switches> = {'<'|'I'|'>'>}{'v'|'-'|'^'>}{'*'|'/'}
<table_switches> = {'+'|'O'|'x'|'#'}
META SYNTAX
{<opt>} => zero or one repetitions
{<opt>}* => zero or more repetitions
[<opt>] => exactly one repetitions
[<opt>]* => one or more repetitions
(<opt1>|<opt2>) => either one of opt1 or opt2, etc.
<opt1>%<opt2> => At least one of opt1 and/or opt2.
(...) => clarify Meta syntax.
<|> = '|'
<SPACE> = space
<Uline> = end of line
<Text> = any wiki text
<Text> = (<|><table>)|<other-wiki-text>
}}}
Meanings:
# A table starts with a newline followed by a '|'
# If the next character is a ‘#’, '+', 'O' or 'X' the following characters are table switches
#If the next character is ‘=’ the following characters are row switches
#Otherwise anything up to the first white space is considered a cell attribute
# Cells and rows may be left'<' centre'I' right'>' aligned
# cells and rows may be bottom 'v' middle '-' and top '^' aligned
# Cells and rows may be bold’*’ or italic’/’ (bold cell within bold line inverts??).
# tables may come with all '#', outer 'O' with inner '+' borders or excluding borders 'x'.
# Within the table definition a row line ending in a ~ is not considered to be a new row. The reason for this is because many tables contain huge amounts of text and it would not be appropriate to have one row on a single line.
# A line beginning by: || indicates a new inner table... where upon a '|' as the last non-white-space character forces an end to the (inner) table (unless escaped '~|') The result is that a few examples of table would be:
{{{
| 'head' 1 | 'head' 2
| simple | table
|=< cell 1 | cell2
| The above row cells are | both left aligned by the ~|=
|=* Bold 'head' 1 | Bold 'head' 2
| cell 11 normal |* cell 12 is bold
|#* 'Header'1 | 'Header' 2 //table header, inner and outer borders, row bold
| Cell 11 | cell 12
| cell 21 is a very long row of text which is far too long to allow another similar row ~
| cell 22 is another very long row of text which is far too long to allow another similar row ~
|<v Cell 31 is left, bottom aligned |> cell 32 is right aligned.
| cell 41 || Cell 42 is a new table and this is Header 1 inner table ~
| Header 2 inner table
| cell 11 inner table | cell 12 inner table |
| cell 21 inner table | cell 22 inner table is last of outer cell 42 |
| last '~|' jumps out of inner table putting us in cell 51 | cell 52
}}}
[[Isonomia]] 2007, April, 28
Version Date Modified Size Author Changes ... Change note
57 28-Apr-2008 19:53 25.823 kB Isonomia to previous
56 28-Apr-2008 19:52 26.016 kB Isonomia to previous | to last
55 28-Apr-2008 19:05 25.605 kB Isonomia to previous | to last
54 28-Apr-2008 19:01 25.397 kB Isonomia to previous | to last
53 28-Apr-2008 18:46 25.169 kB Isonomia to previous | to last
52 28-Apr-2008 18:42 25.091 kB Isonomia to previous | to last
51 25-Apr-2008 17:13 22.032 kB Isonomia to previous | to last
50 26-Sep-2007 09:34 20.998 kB ChuckSmith to previous | to last restore
49 26-Sep-2007 01:15 21.01 kB 219.138.204.162 to previous | to last
48 01-Mar-2007 12:09 20.998 kB RadomirDopieralski to previous | to last use tests not imagination
47 01-Mar-2007 01:37 19.557 kB YvesPiguet to previous | to last
46 01-Mar-2007 00:51 18.691 kB 195.225.49.22 to previous | to last "second option" means monotonity
45 28-Feb-2007 18:47 18.265 kB YvesPiguet to previous | to last Reply
44 28-Feb-2007 17:52 18.018 kB RadomirDopieralski to previous | to last explaining why they are different from headings
43 28-Feb-2007 17:44 17.786 kB YvesPiguet to previous | to last Trailing eq
42 28-Feb-2007 17:34 17.556 kB RadomirDopieralski to previous | to last stripping the = from the end
41 28-Feb-2007 16:58 17.297 kB YvesPiguet to previous | to last cell headings
« This page (revision-57) was last changed on 28-Apr-2008 19:53 by Isonomia