Re: [xwiki-devs] [Proposal] Use to improve the HTML produced by the XHTML renderer for tables

2017-02-20 Thread Guillaume Delhumeau
+1 for the Segiu's message.

2017-02-20 3:42 GMT+01:00 Sergiu Dumitriu :

> Note that only one  is allowed, but in our wiki markup we can use
> as many header rows and cells as we want. And it's not guaranteed that
> the first row only has header cells. For example, what should happen
> with the following table:
>
> |=head|normal cell
> |normal cell|=head
>
> So, I'm +1 for the following rule:
>
> If the table starts with one or more rows containing only header cells,
> then put those rows in a . If the table ends with one or more
> rows containing only header cells, then put those rows in a . If
> other header cells are encountered in the table, or if the first/last
> row contains both header and regular cells, then those cells are put as
>  cells in a regular  row.
>
> Not sure what to do with: if the table contains only header cells, then...?
>
> On 02/19/2017 05:35 AM, Vincent Massol wrote:
> > Hi devs,
> >
> > For the following XWiki Syntax 2.1 input:
> >
> > |=head11|=head12
> > |cell11|cell12
> >
> > We generate the following XHTML 1.0 output:
> >
> > 
> >   
> > 
> >   head11
> >   head12
> > 
> > 
> >   cell11
> >   cell12
> > 
> >   
> > 
> >
> > I think it would be better to generate:
> >
> > 
> >   
> > 
> >   head11
> >   head12
> > 
> >   
> >   
> > 
> >   cell11
> >   cell12
> > 
> >   
> > 
> >
> > Arguments:
> >
> > * More standard.
> > * In addition I read I the XHTML spec that "Table rows may be grouped
> into a table head, table foot, and one or more table body sections, using
> the thead, tfoot and tbody elements, respectively. This division enables
> user agents to support scrolling of table bodies independently of the table
> head and foot. When long tables are printed, the table head and foot
> information may be repeated on each page that contains table data.”
> >
> > I haven’t checked but hopefully it should relatively painless for our
> CSS (unless we use a rule for tbody/tr/th instead of tr/th or th). However
> even if it changes our CSS I still fee it’s the right thing to do with a
> note in the Release Notes for the unlikely chances that it would break
> something.
> >
> > Note tat
> > I know that for example for the http://extensions.xwiki.org/
> xwiki/bin/view/Extension/Datatables+Macro extension, we cannot use xwiki
> syntax because of this issue (this is why the example is using the html
> macro).
> >
> > WDYT?
> >
> > Thanks
> > -Vincent
> >
> > PS: our XHTML parser already supports this as can be verified with the
> following test:
> >
> > {{groovy}}
> > def input = '''
> > 
> >   
> > 
> >   head11
> >   head12
> > 
> >   
> >   
> > 
> >   cell11
> >   cell12
> > 
> >   
> > 
> > '''
> > def xdom = services.rendering.parse(input, 'xhtml/1.0')
> > println "{{{"
> > println services.rendering.render(xdom, 'xwiki/2.1')
> > println "}}}"
> > {{/groovy}}
> >
> >
> >
> >
> >
>
>
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
>



-- 
Guillaume Delhumeau (guillaume.delhum...@xwiki.com)
Research & Development Engineer at XWiki SAS
Committer on the XWiki.org project


Re: [xwiki-devs] [Proposal] Use to improve the HTML produced by the XHTML renderer for tables

2017-02-19 Thread Sergiu Dumitriu
Note that only one  is allowed, but in our wiki markup we can use
as many header rows and cells as we want. And it's not guaranteed that
the first row only has header cells. For example, what should happen
with the following table:

|=head|normal cell
|normal cell|=head

So, I'm +1 for the following rule:

If the table starts with one or more rows containing only header cells,
then put those rows in a . If the table ends with one or more
rows containing only header cells, then put those rows in a . If
other header cells are encountered in the table, or if the first/last
row contains both header and regular cells, then those cells are put as
 cells in a regular  row.

Not sure what to do with: if the table contains only header cells, then...?

On 02/19/2017 05:35 AM, Vincent Massol wrote:
> Hi devs,
> 
> For the following XWiki Syntax 2.1 input:
> 
> |=head11|=head12
> |cell11|cell12
> 
> We generate the following XHTML 1.0 output:
> 
> 
>   
> 
>   head11
>   head12
> 
> 
>   cell11
>   cell12
> 
>   
> 
> 
> I think it would be better to generate:
> 
> 
>   
> 
>   head11
>   head12
> 
>   
>   
> 
>   cell11
>   cell12
> 
>   
> 
> 
> Arguments:
> 
> * More standard. 
> * In addition I read I the XHTML spec that "Table rows may be grouped into a 
> table head, table foot, and one or more table body sections, using the thead, 
> tfoot and tbody elements, respectively. This division enables user agents to 
> support scrolling of table bodies independently of the table head and foot. 
> When long tables are printed, the table head and foot information may be 
> repeated on each page that contains table data.”
> 
> I haven’t checked but hopefully it should relatively painless for our CSS 
> (unless we use a rule for tbody/tr/th instead of tr/th or th). However even 
> if it changes our CSS I still fee it’s the right thing to do with a note in 
> the Release Notes for the unlikely chances that it would break something.
> 
> Note tat
> I know that for example for the 
> http://extensions.xwiki.org/xwiki/bin/view/Extension/Datatables+Macro 
> extension, we cannot use xwiki syntax because of this issue (this is why the 
> example is using the html macro).
> 
> WDYT?
> 
> Thanks
> -Vincent
> 
> PS: our XHTML parser already supports this as can be verified with the 
> following test:
> 
> {{groovy}}
> def input = '''
> 
>   
> 
>   head11
>   head12
> 
>   
>   
> 
>   cell11
>   cell12
> 
>   
> 
> '''
> def xdom = services.rendering.parse(input, 'xhtml/1.0')
> println "{{{"
> println services.rendering.render(xdom, 'xwiki/2.1')
> println "}}}"
> {{/groovy}}
> 
> 
> 
> 
> 


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/


[xwiki-devs] [Proposal] Use to improve the HTML produced by the XHTML renderer for tables

2017-02-19 Thread Vincent Massol
Hi devs,

For the following XWiki Syntax 2.1 input:

|=head11|=head12
|cell11|cell12

We generate the following XHTML 1.0 output:


  

  head11
  head12


  cell11
  cell12

  


I think it would be better to generate:


  

  head11
  head12

  
  

  cell11
  cell12

  


Arguments:

* More standard. 
* In addition I read I the XHTML spec that "Table rows may be grouped into a 
table head, table foot, and one or more table body sections, using the thead, 
tfoot and tbody elements, respectively. This division enables user agents to 
support scrolling of table bodies independently of the table head and foot. 
When long tables are printed, the table head and foot information may be 
repeated on each page that contains table data.”

I haven’t checked but hopefully it should relatively painless for our CSS 
(unless we use a rule for tbody/tr/th instead of tr/th or th). However even if 
it changes our CSS I still fee it’s the right thing to do with a note in the 
Release Notes for the unlikely chances that it would break something.

Note tat
I know that for example for the 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Datatables+Macro 
extension, we cannot use xwiki syntax because of this issue (this is why the 
example is using the html macro).

WDYT?

Thanks
-Vincent

PS: our XHTML parser already supports this as can be verified with the 
following test:

{{groovy}}
def input = '''

  

  head11
  head12

  
  

  cell11
  cell12

  

'''
def xdom = services.rendering.parse(input, 'xhtml/1.0')
println "{{{"
println services.rendering.render(xdom, 'xwiki/2.1')
println "}}}"
{{/groovy}}