You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@corinthia.apache.org by Ian C <ia...@amham.net> on 2015/06/22 14:59:45 UTC

Header level > 6

Hi

I have just been debugging what appeared as a strange error.

Turns out due to a document header of level 7. HTML only has 1 -6.

So when I increment passed 6 I ended up in HTML_HEAD... which explains
what I was seeing.

But how should  we manage header levels greater than 6? With our own
class and a div or something else?

I see in the Word code there are some limit checks when receiving code.
I looked at the Word the generation code but couldn't quite follow it,
getting tired.

Looks like it is limited too.

-- 
Cheers,

Ian C

Re: Header level > 6

Posted by Ian C <ia...@amham.net>.
Thanks for all the feedback on this one.

For the moment I have fixed the immediate issue with a div and a css
class. Once I look at round trip I will revisit and try a -corinthia
named property (or -cor or -corin as a short version). It appears to
work and as Peter mentioned earlier perhaps a restructure suggestion
would be better?

On Tue, Jun 23, 2015 at 3:54 AM, jan i <ja...@apache.org> wrote:
> On 22 June 2015 at 20:20, Peter Kelly <pm...@apache.org> wrote:
>
>> > On 23 Jun 2015, at 1:10 am, Franz de Copenhague <fr...@apache.org>
>> wrote:
>> >
>> > <p class="Strong" id="word253" style="corinthia-outline-level:2">
>> >       <span id="word259">This is a paragraph Strong with outline level
>> 2</span>
>> >  </p>
>> >
>> > Or
>> >
>> > <p class="Strong" id="word253" data-corinthia-outline-level=2">
>> >       <span id="word259">This is a paragraph Strong with outline level
>> 2</span>
>> >  </p>
>>
>> Of these two, I think that the CSS property would be the better choice.
>> The main reason is that we could use it in both style definitions *and*
>> inline style attributes; that is, it would be consistent. As Jan mentioned,
>> this would allow us to maintain information about heading levels greater
>> than 6, while still having fully valid HTML and CSS.
>>
>> It’s my understanding that it’s pretty widely accepted practice to add
>> vendor prefixes to CSS properties, so this shouldn’t pose a problem. I
>> think it’s usually done with a leading - though, so we could have
>> -corinthia-outline-level=N
>>
> +1 to your naming scheme, there was some talks about 2 years ago, about
> standardizing the names (giving you a possibility to register the vendor
> name).
>
> rgds
> jan i
>
>>
>> —
>> Dr Peter M. Kelly
>> pmkelly@apache.org
>>
>> PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
>> (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)
>>
>>



-- 
Cheers,

Ian C

Re: Header level > 6

Posted by jan i <ja...@apache.org>.
On 22 June 2015 at 20:20, Peter Kelly <pm...@apache.org> wrote:

> > On 23 Jun 2015, at 1:10 am, Franz de Copenhague <fr...@apache.org>
> wrote:
> >
> > <p class="Strong" id="word253" style="corinthia-outline-level:2">
> >       <span id="word259">This is a paragraph Strong with outline level
> 2</span>
> >  </p>
> >
> > Or
> >
> > <p class="Strong" id="word253" data-corinthia-outline-level=2">
> >       <span id="word259">This is a paragraph Strong with outline level
> 2</span>
> >  </p>
>
> Of these two, I think that the CSS property would be the better choice.
> The main reason is that we could use it in both style definitions *and*
> inline style attributes; that is, it would be consistent. As Jan mentioned,
> this would allow us to maintain information about heading levels greater
> than 6, while still having fully valid HTML and CSS.
>
> It’s my understanding that it’s pretty widely accepted practice to add
> vendor prefixes to CSS properties, so this shouldn’t pose a problem. I
> think it’s usually done with a leading - though, so we could have
> -corinthia-outline-level=N
>
+1 to your naming scheme, there was some talks about 2 years ago, about
standardizing the names (giving you a possibility to register the vendor
name).

rgds
jan i

>
> —
> Dr Peter M. Kelly
> pmkelly@apache.org
>
> PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
> (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)
>
>

RE: Header level > 6

Posted by Franz de Copenhague <fr...@outlook.com>.
+1 Vendor specific CSS property/value

based on http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords  -corinthia-* is good, but we can think in a shorted one.
franz

> From: pmkelly@apache.org
> Subject: Re: Header level > 6
> Date: Tue, 23 Jun 2015 01:22:03 +0700
> To: dev@corinthia.incubator.apache.org
> 
> > On 23 Jun 2015, at 1:20 am, Peter Kelly <pm...@apache.org> wrote:
> > 
> > It’s my understanding that it’s pretty widely accepted practice to add vendor prefixes to CSS properties, so this shouldn’t pose a problem. I think it’s usually done with a leading - though, so we could have -corinthia-outline-level=N
> 
> Minor correction: that would be -corinthia-outline-level: N (using : instead of =)
> 
> —
> Dr Peter M. Kelly
> pmkelly@apache.org
> 
> PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
> (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)
> 
 		 	   		  

Re: Header level > 6

Posted by Peter Kelly <pm...@apache.org>.
> On 23 Jun 2015, at 1:20 am, Peter Kelly <pm...@apache.org> wrote:
> 
> It’s my understanding that it’s pretty widely accepted practice to add vendor prefixes to CSS properties, so this shouldn’t pose a problem. I think it’s usually done with a leading - though, so we could have -corinthia-outline-level=N

Minor correction: that would be -corinthia-outline-level: N (using : instead of =)

—
Dr Peter M. Kelly
pmkelly@apache.org

PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
(fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)


Re: Header level > 6

Posted by Peter Kelly <pm...@apache.org>.
> On 23 Jun 2015, at 1:10 am, Franz de Copenhague <fr...@apache.org> wrote:
> 
> <p class="Strong" id="word253" style="corinthia-outline-level:2">
>       <span id="word259">This is a paragraph Strong with outline level 2</span>
>  </p>
> 
> Or
> 
> <p class="Strong" id="word253" data-corinthia-outline-level=2">
>       <span id="word259">This is a paragraph Strong with outline level 2</span>
>  </p>

Of these two, I think that the CSS property would be the better choice. The main reason is that we could use it in both style definitions *and* inline style attributes; that is, it would be consistent. As Jan mentioned, this would allow us to maintain information about heading levels greater than 6, while still having fully valid HTML and CSS.

It’s my understanding that it’s pretty widely accepted practice to add vendor prefixes to CSS properties, so this shouldn’t pose a problem. I think it’s usually done with a leading - though, so we could have -corinthia-outline-level=N

—
Dr Peter M. Kelly
pmkelly@apache.org

PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
(fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)


RE: Header level > 6

Posted by Franz de Copenhague <fr...@apache.org>.

> Date: Mon, 22 Jun 2015 19:09:41 +0200
> Subject: Re: Header level > 6
> From: jani@apache.org
> To: dev@corinthia.incubator.apache.org
> 
> On 22 June 2015 at 18:53, Peter Kelly <pm...@apache.org> wrote:
> 
> > My first instinct on hearing “heading level 7” is that perhaps the author
> > of such a document should reconsider their structure ;) I never go more
> > than three for normal documents. The designers HTML assumed 6 would be
> > enough, but Word allows up to 9 levels.
> >
> > Having >6 levels can be handy for outlining (in particular Word’s “outline
> > view” mode), and in that instance I can see it would be useful.
> >
> > Regardless of it’s merits or otherwise, I think we should support this,
> > but it will complicate things somewhat given that the existing logic
> > generally assumes only six levels. Any levels above that, in the Word
> > filter at least, are simply given their style name but otherwise considered
> > normal paragraphs.
> >
> > Having a <div style=“corinthia-level-X”> is a good first approach (and I
> > suggest using the corinthia- prefix in places where we have our own special
> > behaviour; currently the prefix is uxwrite- in many places but that should
> > be changed). However, it’s possible in Word to have multiple heading styles
> > at the same outline level - for 1-6 this is fine, because we just give the
> > style name and can express the outline level in HTML based on the tag
> > number (h1 through h6). When we go to having <div> or <p> elements with a
> > style name, there is no way to express the outline level as part of that,
> > at least none that is immediately obvious to me. I’m not sure what the best
> > solution here is for handling arbitrary depths.
> >
> > In theory we may also have file formats which support more than 9 outline
> > levels (not sure what ODF’s limit is, but it may be possible with other
> > formats). In that case we need to figure out how that would be expressed in
> > terms of a Word document.
> >
> > Another possible solution is to just use h6 for every header of level
> > greater than 6. While this “loses” information in the resulting HTML, I
> > view it as a reasonable compromise in the sense that it fits within the
> > semantics of HTML, and due to the use of bidirectional transformations, the
> > heading level could remain the same (that is, 7 or greater) during update
> > if the level has not been changed to < 6 during editing.
> >
> 
> but if we convert from OOXML to ODF this way we loose information. It is no
> fun when the intermediary (in this case HTML) imposes the restrictions.
> 
> I do not recommend to flatten the level at the height of H6.
> 
> rgds
> jan i.
> 

In ODT the outline is up to "Level 10", and DOCX is up to "Level 9". 
We are missing that any single paragraph with any style assigned, different to Heading 1,2, 3, can have the outline level property set.  I have attached 2 examples, that can illustrates what I am saying. For example, in case of DOCX, The current GET conversion to HTML for the paragraph with Strong style is:
<p class="Normal" id="word253">      <span class="Strong" id="word259">This is a paragraph Strong with outline level 2</span> </p>In this link you can GET the complete HTML generated for the DOCX example. http://www.franzdecopenhague.org/get/OutlineLevel.docx/

In this case, the outline level information doesn't appear in the converted HTML and certainly, it will be lost in the PUT. 
So, we need to find the way to keep Strong style and outline level information. One possibility could be:
<p class="Strong" id="word253" style="corinthia-outline-level:2">      <span id="word259">This is a paragraph Strong with outline level 2</span> </p>
Or
<p class="Strong" id="word253" data-corinthia-outline-level=2">      <span id="word259">This is a paragraph Strong with outline level 2</span> </p>


Franz
 		 	   		  

Re: Header level > 6

Posted by jan i <ja...@apache.org>.
On 22 June 2015 at 18:53, Peter Kelly <pm...@apache.org> wrote:

> My first instinct on hearing “heading level 7” is that perhaps the author
> of such a document should reconsider their structure ;) I never go more
> than three for normal documents. The designers HTML assumed 6 would be
> enough, but Word allows up to 9 levels.
>
> Having >6 levels can be handy for outlining (in particular Word’s “outline
> view” mode), and in that instance I can see it would be useful.
>
> Regardless of it’s merits or otherwise, I think we should support this,
> but it will complicate things somewhat given that the existing logic
> generally assumes only six levels. Any levels above that, in the Word
> filter at least, are simply given their style name but otherwise considered
> normal paragraphs.
>
> Having a <div style=“corinthia-level-X”> is a good first approach (and I
> suggest using the corinthia- prefix in places where we have our own special
> behaviour; currently the prefix is uxwrite- in many places but that should
> be changed). However, it’s possible in Word to have multiple heading styles
> at the same outline level - for 1-6 this is fine, because we just give the
> style name and can express the outline level in HTML based on the tag
> number (h1 through h6). When we go to having <div> or <p> elements with a
> style name, there is no way to express the outline level as part of that,
> at least none that is immediately obvious to me. I’m not sure what the best
> solution here is for handling arbitrary depths.
>
> In theory we may also have file formats which support more than 9 outline
> levels (not sure what ODF’s limit is, but it may be possible with other
> formats). In that case we need to figure out how that would be expressed in
> terms of a Word document.
>
> Another possible solution is to just use h6 for every header of level
> greater than 6. While this “loses” information in the resulting HTML, I
> view it as a reasonable compromise in the sense that it fits within the
> semantics of HTML, and due to the use of bidirectional transformations, the
> heading level could remain the same (that is, 7 or greater) during update
> if the level has not been changed to < 6 during editing.
>

but if we convert from OOXML to ODF this way we loose information. It is no
fun when the intermediary (in this case HTML) imposes the restrictions.

I do not recommend to flatten the level at the height of H6.

rgds
jan i.


>
> —
> Dr Peter M. Kelly
> pmkelly@apache.org
>
> PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
> (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)
>
> > On 22 Jun 2015, at 8:22 pm, jan i <ja...@apache.org> wrote:
> >
> > I want us to be consistent, not have one standard for header 1-6 and a
> > different for the rest.
> >
> > we can also use <p style=headerX> that is more or less the same as <div
> > style=headerX>. Only real difference
> > is that <div> do not have a default style.
> >
> > rgds
> > jan i.
> >
> > On 22 June 2015 at 15:18, Gabriela Gibson <ga...@gmail.com>
> wrote:
> >
> >> IIRC, Peter said to just make a <p> here.
> >>
> >> But I think I like Jan's idea because we can then later change things
> >> easily without losing the original marker of H7+.
> >>
> >> G
> >>
> >> On Mon, Jun 22, 2015 at 2:15 PM, jan i <ja...@apache.org> wrote:
> >>
> >>> On 22 June 2015 at 14:59, Ian C <ia...@amham.net> wrote:
> >>>
> >>>> Hi
> >>>>
> >>>> I have just been debugging what appeared as a strange error.
> >>>>
> >>>> Turns out due to a document header of level 7. HTML only has 1 -6.
> >>>>
> >>>> So when I increment passed 6 I ended up in HTML_HEAD... which explains
> >>>> what I was seeing.
> >>>>
> >>>> But how should  we manage header levels greater than 6? With our own
> >>>> class and a div or something else?
> >>>>
> >>> my preference would be a div statement, linked to our own style (which
> of
> >>> course might be modified by the document).
> >>>
> >>> rgds
> >>> jan i.
> >>>
> >>>
> >>>>
> >>>> I see in the Word code there are some limit checks when receiving
> code.
> >>>> I looked at the Word the generation code but couldn't quite follow it,
> >>>> getting tired.
> >>>>
> >>>> Looks like it is limited too.
> >>>>
> >>>> --
> >>>> Cheers,
> >>>>
> >>>> Ian C
> >>>>
> >>>
> >>
> >>
> >>
> >> --
> >> Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
> >>
>
>

Re: Header level > 6

Posted by Peter Kelly <pm...@apache.org>.
My first instinct on hearing “heading level 7” is that perhaps the author of such a document should reconsider their structure ;) I never go more than three for normal documents. The designers HTML assumed 6 would be enough, but Word allows up to 9 levels.

Having >6 levels can be handy for outlining (in particular Word’s “outline view” mode), and in that instance I can see it would be useful.

Regardless of it’s merits or otherwise, I think we should support this, but it will complicate things somewhat given that the existing logic generally assumes only six levels. Any levels above that, in the Word filter at least, are simply given their style name but otherwise considered normal paragraphs.

Having a <div style=“corinthia-level-X”> is a good first approach (and I suggest using the corinthia- prefix in places where we have our own special behaviour; currently the prefix is uxwrite- in many places but that should be changed). However, it’s possible in Word to have multiple heading styles at the same outline level - for 1-6 this is fine, because we just give the style name and can express the outline level in HTML based on the tag number (h1 through h6). When we go to having <div> or <p> elements with a style name, there is no way to express the outline level as part of that, at least none that is immediately obvious to me. I’m not sure what the best solution here is for handling arbitrary depths.

In theory we may also have file formats which support more than 9 outline levels (not sure what ODF’s limit is, but it may be possible with other formats). In that case we need to figure out how that would be expressed in terms of a Word document.

Another possible solution is to just use h6 for every header of level greater than 6. While this “loses” information in the resulting HTML, I view it as a reasonable compromise in the sense that it fits within the semantics of HTML, and due to the use of bidirectional transformations, the heading level could remain the same (that is, 7 or greater) during update if the level has not been changed to < 6 during editing.

—
Dr Peter M. Kelly
pmkelly@apache.org

PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
(fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)

> On 22 Jun 2015, at 8:22 pm, jan i <ja...@apache.org> wrote:
> 
> I want us to be consistent, not have one standard for header 1-6 and a
> different for the rest.
> 
> we can also use <p style=headerX> that is more or less the same as <div
> style=headerX>. Only real difference
> is that <div> do not have a default style.
> 
> rgds
> jan i.
> 
> On 22 June 2015 at 15:18, Gabriela Gibson <ga...@gmail.com> wrote:
> 
>> IIRC, Peter said to just make a <p> here.
>> 
>> But I think I like Jan's idea because we can then later change things
>> easily without losing the original marker of H7+.
>> 
>> G
>> 
>> On Mon, Jun 22, 2015 at 2:15 PM, jan i <ja...@apache.org> wrote:
>> 
>>> On 22 June 2015 at 14:59, Ian C <ia...@amham.net> wrote:
>>> 
>>>> Hi
>>>> 
>>>> I have just been debugging what appeared as a strange error.
>>>> 
>>>> Turns out due to a document header of level 7. HTML only has 1 -6.
>>>> 
>>>> So when I increment passed 6 I ended up in HTML_HEAD... which explains
>>>> what I was seeing.
>>>> 
>>>> But how should  we manage header levels greater than 6? With our own
>>>> class and a div or something else?
>>>> 
>>> my preference would be a div statement, linked to our own style (which of
>>> course might be modified by the document).
>>> 
>>> rgds
>>> jan i.
>>> 
>>> 
>>>> 
>>>> I see in the Word code there are some limit checks when receiving code.
>>>> I looked at the Word the generation code but couldn't quite follow it,
>>>> getting tired.
>>>> 
>>>> Looks like it is limited too.
>>>> 
>>>> --
>>>> Cheers,
>>>> 
>>>> Ian C
>>>> 
>>> 
>> 
>> 
>> 
>> --
>> Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
>> 


Re: Header level > 6

Posted by jan i <ja...@apache.org>.
I want us to be consistent, not have one standard for header 1-6 and a
different for the rest.

we can also use <p style=headerX> that is more or less the same as <div
style=headerX>. Only real difference
is that <div> do not have a default style.

rgds
jan i.

On 22 June 2015 at 15:18, Gabriela Gibson <ga...@gmail.com> wrote:

> IIRC, Peter said to just make a <p> here.
>
> But I think I like Jan's idea because we can then later change things
> easily without losing the original marker of H7+.
>
> G
>
> On Mon, Jun 22, 2015 at 2:15 PM, jan i <ja...@apache.org> wrote:
>
> > On 22 June 2015 at 14:59, Ian C <ia...@amham.net> wrote:
> >
> > > Hi
> > >
> > > I have just been debugging what appeared as a strange error.
> > >
> > > Turns out due to a document header of level 7. HTML only has 1 -6.
> > >
> > > So when I increment passed 6 I ended up in HTML_HEAD... which explains
> > > what I was seeing.
> > >
> > > But how should  we manage header levels greater than 6? With our own
> > > class and a div or something else?
> > >
> > my preference would be a div statement, linked to our own style (which of
> > course might be modified by the document).
> >
> > rgds
> > jan i.
> >
> >
> > >
> > > I see in the Word code there are some limit checks when receiving code.
> > > I looked at the Word the generation code but couldn't quite follow it,
> > > getting tired.
> > >
> > > Looks like it is limited too.
> > >
> > > --
> > > Cheers,
> > >
> > > Ian C
> > >
> >
>
>
>
> --
> Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
>

Re: Header level > 6

Posted by Gabriela Gibson <ga...@gmail.com>.
IIRC, Peter said to just make a <p> here.

But I think I like Jan's idea because we can then later change things
easily without losing the original marker of H7+.

G

On Mon, Jun 22, 2015 at 2:15 PM, jan i <ja...@apache.org> wrote:

> On 22 June 2015 at 14:59, Ian C <ia...@amham.net> wrote:
>
> > Hi
> >
> > I have just been debugging what appeared as a strange error.
> >
> > Turns out due to a document header of level 7. HTML only has 1 -6.
> >
> > So when I increment passed 6 I ended up in HTML_HEAD... which explains
> > what I was seeing.
> >
> > But how should  we manage header levels greater than 6? With our own
> > class and a div or something else?
> >
> my preference would be a div statement, linked to our own style (which of
> course might be modified by the document).
>
> rgds
> jan i.
>
>
> >
> > I see in the Word code there are some limit checks when receiving code.
> > I looked at the Word the generation code but couldn't quite follow it,
> > getting tired.
> >
> > Looks like it is limited too.
> >
> > --
> > Cheers,
> >
> > Ian C
> >
>



-- 
Visit my Coding Diary: http://gabriela-gibson.blogspot.com/

Re: Header level > 6

Posted by jan i <ja...@apache.org>.
On 22 June 2015 at 14:59, Ian C <ia...@amham.net> wrote:

> Hi
>
> I have just been debugging what appeared as a strange error.
>
> Turns out due to a document header of level 7. HTML only has 1 -6.
>
> So when I increment passed 6 I ended up in HTML_HEAD... which explains
> what I was seeing.
>
> But how should  we manage header levels greater than 6? With our own
> class and a div or something else?
>
my preference would be a div statement, linked to our own style (which of
course might be modified by the document).

rgds
jan i.


>
> I see in the Word code there are some limit checks when receiving code.
> I looked at the Word the generation code but couldn't quite follow it,
> getting tired.
>
> Looks like it is limited too.
>
> --
> Cheers,
>
> Ian C
>