Re: Why div in HTML exports instead of p?

2013-06-07 Thread Jean-Marc Lasgouttes

06/06/2013 18:35, Richard Heck:

Span is more or less allowed everywhere. Of course, span is by default
inline. But you can get it to act like a div by setting display:block in
CSS. Cheating, no doubt.


So a span is designed to be included in the flow of the text, like a 
footnote is... Why is that cheating?


JMarc



Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/07/2013 04:51 AM, Jean-Marc Lasgouttes wrote:

06/06/2013 18:35, Richard Heck:

Span is more or less allowed everywhere. Of course, span is by default
inline. But you can get it to act like a div by setting display:block in
CSS. Cheating, no doubt.


So a span is designed to be included in the flow of the text, like a 
footnote is... Why is that cheating?


span is really meant for things like text ranges.

rh



Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/06/2013 05:12 PM, Steve Litt wrote:


How would I override the stdsections.inc styles' HTMLTag in my layout?
My layout files don't define styles already given me by LyX's book
style, but instead just add new styles. What would be the quickest,
easiest way within a layout file to modify HTMLTag for Standard, Part,
Section, Subsection, SubSubSection, Paragraph and SubParagraph? Could I
do something like this Assuming starting with the Article document
class and not using Part:

Style Section
   CopyStyle Section
   HTMLTag h1
End

Style Standard
   CopyStyle Standard
   HTMLTag p
End


You don't need the CopyStyle stuff. The rest will update the style if
it already exists, not over-write it.

Richard



Re: Why div in HTML exports instead of p?

2013-06-07 Thread Steve Litt
On Fri, 07 Jun 2013 11:51:34 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/06/2013 05:12 PM, Steve Litt wrote:
 
  How would I override the stdsections.inc styles' HTMLTag in my
  layout? My layout files don't define styles already given me by
  LyX's book style, but instead just add new styles. What would be
  the quickest, easiest way within a layout file to modify HTMLTag
  for Standard, Part, Section, Subsection, SubSubSection, Paragraph
  and SubParagraph? Could I do something like this Assuming starting
  with the Article document class and not using Part:
 
  Style Section
 CopyStyle Section
 HTMLTag h1
  End
 
  Style Standard
 CopyStyle Standard
 HTMLTag p
  End
 
 You don't need the CopyStyle stuff. The rest will update the style
 if it already exists, not over-write it.
 
 Richard

Thanks Richard,

With or without the CopyStyle, it wouldn't substitute the tag in
HTMLTag for the default div.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/07/2013 05:28 PM, Steve Litt wrote:

On Fri, 07 Jun 2013 11:51:34 -0400
Richard Heck rgh...@lyx.org wrote:


On 06/06/2013 05:12 PM, Steve Litt wrote:

How would I override the stdsections.inc styles' HTMLTag in my
layout? My layout files don't define styles already given me by
LyX's book style, but instead just add new styles. What would be
the quickest, easiest way within a layout file to modify HTMLTag
for Standard, Part, Section, Subsection, SubSubSection, Paragraph
and SubParagraph? Could I do something like this Assuming starting
with the Article document class and not using Part:

Style Section
CopyStyle Section
HTMLTag h1
End

Style Standard
CopyStyle Standard
HTMLTag p
End

You don't need the CopyStyle stuff. The rest will update the style
if it already exists, not over-write it.

Richard

Thanks Richard,

With or without the CopyStyle, it wouldn't substitute the tag in
HTMLTag for the default div.


See the attached. I've put the relevant layout into Document
Setttings Local Layout.

Note that load order of layout stuff matters. You would need to
load stdsections.inc, or whatever loads it, first, and then do your
customizations. One nice thing about Local Layout is that it
always comes last.

Richard



h.lyx
Description: application/lyx


Re: Why div in HTML exports instead of p?

2013-06-07 Thread Steve Litt
On Fri, 07 Jun 2013 17:52:18 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/07/2013 05:28 PM, Steve Litt wrote:

  Thanks Richard,
 
  With or without the CopyStyle, it wouldn't substitute the tag in
  HTMLTag for the default div.
 
 See the attached. I've put the relevant layout into Document
 Setttings Local Layout.

Hi Richard,

The attached doc was doc class article. The only thing I saw that
indicated it was tweaked was the document preamble in the LyX file
contained:

\usepackage{heck}

But I don't know what was in package heck or where to put it.

 
 Note that load order of layout stuff matters. You would need to
 load stdsections.inc, or whatever loads it, first,

Would I do that at the top of my layout file?

 and then do your
 customizations. One nice thing about Local Layout is that it
 always comes last.

But then again, to use LyX as a quickie web page writer, I'd need to
have one central layout file not local.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/07/2013 06:22 PM, Steve Litt wrote:

On Fri, 07 Jun 2013 17:52:18 -0400
Richard Heck rgh...@lyx.org wrote:


On 06/07/2013 05:28 PM, Steve Litt wrote:

Thanks Richard,

With or without the CopyStyle, it wouldn't substitute the tag in
HTMLTag for the default div.

See the attached. I've put the relevant layout into Document
Setttings Local Layout.

Hi Richard,

The attached doc was doc class article. The only thing I saw that
indicated it was tweaked was the document preamble in the LyX file
contained:

\usepackage{heck}

But I don't know what was in package heck or where to put it.


That's not relevant. See Document Settings Local Layout.




Note that load order of layout stuff matters. You would need to
load stdsections.inc, or whatever loads it, first,

Would I do that at the top of my layout file?


Post the layout file if not sure.

Richard



Re: Why div in HTML exports instead of p?

2013-06-07 Thread Jean-Marc Lasgouttes

06/06/2013 18:35, Richard Heck:

Span is more or less allowed everywhere. Of course, span is by default
inline. But you can get it to act like a div by setting display:block in
CSS. Cheating, no doubt.


So a span is designed to be included in the flow of the text, like a 
footnote is... Why is that cheating?


JMarc



Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/07/2013 04:51 AM, Jean-Marc Lasgouttes wrote:

06/06/2013 18:35, Richard Heck:

Span is more or less allowed everywhere. Of course, span is by default
inline. But you can get it to act like a div by setting display:block in
CSS. Cheating, no doubt.


So a span is designed to be included in the flow of the text, like a 
footnote is... Why is that cheating?


span is really meant for things like text ranges.

rh



Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/06/2013 05:12 PM, Steve Litt wrote:


How would I override the stdsections.inc styles' HTMLTag in my layout?
My layout files don't define styles already given me by LyX's book
style, but instead just add new styles. What would be the quickest,
easiest way within a layout file to modify HTMLTag for Standard, Part,
Section, Subsection, SubSubSection, Paragraph and SubParagraph? Could I
do something like this Assuming starting with the Article document
class and not using Part:

Style Section
   CopyStyle Section
   HTMLTag h1
End

Style Standard
   CopyStyle Standard
   HTMLTag p
End


You don't need the CopyStyle stuff. The rest will update the style if
it already exists, not over-write it.

Richard



Re: Why div in HTML exports instead of p?

2013-06-07 Thread Steve Litt
On Fri, 07 Jun 2013 11:51:34 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/06/2013 05:12 PM, Steve Litt wrote:
 
  How would I override the stdsections.inc styles' HTMLTag in my
  layout? My layout files don't define styles already given me by
  LyX's book style, but instead just add new styles. What would be
  the quickest, easiest way within a layout file to modify HTMLTag
  for Standard, Part, Section, Subsection, SubSubSection, Paragraph
  and SubParagraph? Could I do something like this Assuming starting
  with the Article document class and not using Part:
 
  Style Section
 CopyStyle Section
 HTMLTag h1
  End
 
  Style Standard
 CopyStyle Standard
 HTMLTag p
  End
 
 You don't need the CopyStyle stuff. The rest will update the style
 if it already exists, not over-write it.
 
 Richard

Thanks Richard,

With or without the CopyStyle, it wouldn't substitute the tag in
HTMLTag for the default div.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/07/2013 05:28 PM, Steve Litt wrote:

On Fri, 07 Jun 2013 11:51:34 -0400
Richard Heck rgh...@lyx.org wrote:


On 06/06/2013 05:12 PM, Steve Litt wrote:

How would I override the stdsections.inc styles' HTMLTag in my
layout? My layout files don't define styles already given me by
LyX's book style, but instead just add new styles. What would be
the quickest, easiest way within a layout file to modify HTMLTag
for Standard, Part, Section, Subsection, SubSubSection, Paragraph
and SubParagraph? Could I do something like this Assuming starting
with the Article document class and not using Part:

Style Section
CopyStyle Section
HTMLTag h1
End

Style Standard
CopyStyle Standard
HTMLTag p
End

You don't need the CopyStyle stuff. The rest will update the style
if it already exists, not over-write it.

Richard

Thanks Richard,

With or without the CopyStyle, it wouldn't substitute the tag in
HTMLTag for the default div.


See the attached. I've put the relevant layout into Document
Setttings Local Layout.

Note that load order of layout stuff matters. You would need to
load stdsections.inc, or whatever loads it, first, and then do your
customizations. One nice thing about Local Layout is that it
always comes last.

Richard



h.lyx
Description: application/lyx


Re: Why div in HTML exports instead of p?

2013-06-07 Thread Steve Litt
On Fri, 07 Jun 2013 17:52:18 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/07/2013 05:28 PM, Steve Litt wrote:

  Thanks Richard,
 
  With or without the CopyStyle, it wouldn't substitute the tag in
  HTMLTag for the default div.
 
 See the attached. I've put the relevant layout into Document
 Setttings Local Layout.

Hi Richard,

The attached doc was doc class article. The only thing I saw that
indicated it was tweaked was the document preamble in the LyX file
contained:

\usepackage{heck}

But I don't know what was in package heck or where to put it.

 
 Note that load order of layout stuff matters. You would need to
 load stdsections.inc, or whatever loads it, first,

Would I do that at the top of my layout file?

 and then do your
 customizations. One nice thing about Local Layout is that it
 always comes last.

But then again, to use LyX as a quickie web page writer, I'd need to
have one central layout file not local.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-07 Thread Richard Heck

On 06/07/2013 06:22 PM, Steve Litt wrote:

On Fri, 07 Jun 2013 17:52:18 -0400
Richard Heck rgh...@lyx.org wrote:


On 06/07/2013 05:28 PM, Steve Litt wrote:

Thanks Richard,

With or without the CopyStyle, it wouldn't substitute the tag in
HTMLTag for the default div.

See the attached. I've put the relevant layout into Document
Setttings Local Layout.

Hi Richard,

The attached doc was doc class article. The only thing I saw that
indicated it was tweaked was the document preamble in the LyX file
contained:

\usepackage{heck}

But I don't know what was in package heck or where to put it.


That's not relevant. See Document Settings Local Layout.




Note that load order of layout stuff matters. You would need to
load stdsections.inc, or whatever loads it, first,

Would I do that at the top of my layout file?


Post the layout file if not sure.

Richard



Why div in HTML exports instead of p?

2013-06-06 Thread Steve Litt
Hi all,

I decided to try my hand at using LyX to quickly write web pages. When
I converted to either LyXHTML or HTML, the result delineated paragraphs
not with p, but with div. 

That's certainly not how I want my websites to be written. To me, div
is a description of appearance: fingerpainting. To me, p is a
description of functionality, which is what I want.

p can have class=mystyle just like div can, with CSS defining
what mystyle looks like. So I'm not sure what's gained by using div
for all paragraphs.

Similarly, a casual perusal of the output looks to me like all headings
are h1 with different classes part, section, etc. This also casts
aside HTML's natural structure and meanings, keeping the appearance. Of
course, to map part/chapter/section/subsection/subsubsection/paragraph
to HTML's h1 thru h6 would require an outside mapping, but I think
a knowledgeable author could make that mapping in five minutes.

None of this is vital to me. I can always make a Vim script that
replaces div with p, replaces h1 with the proper h? level
depending on the class, etc. I'm just curious why it was chosen, both
by export to HTML and export to LyXHTML, to map to HTML appearance
instead of HTML structure.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 08:34 AM, Steve Litt wrote:

Hi all,

I decided to try my hand at using LyX to quickly write web pages. When
I converted to either LyXHTML or HTML, the result delineated paragraphs
not with p, but with div.

That's certainly not how I want my websites to be written. To me, div
is a description of appearance: fingerpainting. To me, p is a
description of functionality, which is what I want.

p can have class=mystyle just like div can, with CSS defining
what mystyle looks like. So I'm not sure what's gained by using div
for all paragraphs.

Similarly, a casual perusal of the output looks to me like all headings
are h1 with different classes part, section, etc. This also casts
aside HTML's natural structure and meanings, keeping the appearance. Of
course, to map part/chapter/section/subsection/subsubsection/paragraph
to HTML's h1 thru h6 would require an outside mapping, but I think
a knowledgeable author could make that mapping in five minutes.

None of this is vital to me. I can always make a Vim script that
replaces div with p, replaces h1 with the proper h? level
depending on the class, etc. I'm just curious why it was chosen, both
by export to HTML and export to LyXHTML, to map to HTML appearance
instead of HTML structure.


Almost all such things can be modified via layout. In this case:
Style Standard
HTMLTag p
End
Put it in local layout, a module, whatever you want, and more generally
see section 5.4 of the Customization manual.

That said, the reason it is done this way is because the default layout,
Standard, is used inside other kinds of things, where p would not be
allowed. At least, I seem to remember that is why I did it that way. There
is actually a similar problem now with footnotes, which are formatted
via div, which is not allowed, e.g., in a heading.

Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Jean-Marc Lasgouttes

06/06/2013 15:47, Richard Heck:

That said, the reason it is done this way is because the default
layout, Standard, is used inside other kinds of things, where p
would not be allowed. At least, I seem to remember that is why I did
it that way.


It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.

And what about h1/h2/h3... ?

JMarc


Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 09:54 AM, Jean-Marc Lasgouttes wrote:

06/06/2013 15:47, Richard Heck:

That said, the reason it is done this way is because the default
layout, Standard, is used inside other kinds of things, where p
would not be allowed. At least, I seem to remember that is why I did
it that way.


It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.


The use of div for paragraphs is not unusual. One sees it quite alot on the
web. I suppose it would be possible to test, as we do output, for the case
when we are embedded in some context where p is not allowed. That could
be filed as a bug.


And what about h1/h2/h3... ?


This was just wrong. h1 is used for both part and chapter, with different
classes. h2 is used for sections, h3 for subsections, etc. See 
stdsections.inc

for the details, all of which, again, can be modified via layout.

Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Jean-Marc Lasgouttes

06/06/2013 16:02, Richard Heck:

It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.


The use of div for paragraphs is not unusual. One sees it quite alot on the
web.


I can also find lots of interesting MSword documenta on the web :) It is 
a matter of semantics

http://stackoverflow.com/questions/2226562/what-is-the-difference-between-p-and-div

[do philosophers care about semantics?]


And what about h1/h2/h3... ?


This was just wrong. h1 is used for both part and chapter, with different
classes. h2 is used for sections, h3 for subsections, etc. See
stdsections.inc
for the details, all of which, again, can be modified via layout.


Good.

JMarc



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 10:22 AM, Jean-Marc Lasgouttes wrote:

06/06/2013 16:02, Richard Heck:

It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.


The use of div for paragraphs is not unusual. One sees it quite alot 
on the

web.


I can also find lots of interesting MSword documenta on the web :) It 
is a matter of semantics
http://stackoverflow.com/questions/2226562/what-is-the-difference-between-p-and-div 



Yes, I know, but especially with auto-generated documents, the use of 
p causes problems, which is why people avoid it.


Here's an example of what led to this:

p class=standardThis is a paragraph.div class=footnotep 
class=standardThis is a footnote./pp class=standardWith two 
paragraphs./p/div Rest of paragraph./p


That is invalid. Whereas if you replace p with div it is fine.

Again, we could try to detect this, but it's hard to know how to do it 
without making assumptions. What if someone did use div for Standard? 
Then there is nothing to detect.


It starts to feel like we need to code the entire DTD and check 
everything we do against it.


For what it's worth, really solving the problem of footnotes inside 
headings (div not allowed inside h2, e.g.) may require enough machinery 
to do this too. The div paragraphs inside the footnote (which now has to 
be treated as span) won't be permitted either.


Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Jean-Marc Lasgouttes

06/06/2013 16:33, Richard Heck:

Here's an example of what led to this:

p class=standardThis is a paragraph.div class=footnotep
class=standardThis is a footnote./pp class=standardWith two
paragraphs./p/div Rest of paragraph./p

That is invalid. Whereas if you replace p with div it is fine.


Which p? The inner one?


Again, we could try to detect this, but it's hard to know how to do it
without making assumptions. What if someone did use div for Standard?
Then there is nothing to detect.

It starts to feel like we need to code the entire DTD and check
everything we do against it.


This is not nice indeed.


For what it's worth, really solving the problem of footnotes inside
headings (div not allowed inside h2, e.g.) may require enough machinery
to do this too. The div paragraphs inside the footnote (which now has to
be treated as span) won't be permitted either.


What is the difference between div and span in in this case?

JMarc



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 12:21 PM, Jean-Marc Lasgouttes wrote:

06/06/2013 16:33, Richard Heck:

Here's an example of what led to this:

p class=standardThis is a paragraph.div class=footnotep
class=standardThis is a footnote./pp class=standardWith two
paragraphs./p/div Rest of paragraph./p

That is invalid. Whereas if you replace p with div it is fine.


Which p? The inner one?


Yes. No p inside p. Most browsers will allow it, but when Firefox is 
in a strict XHTML mode, it simply refuses to load the document. And you 
have to be in that mode, in Firefox, at least, in order to use MathML. I 
suspect that the ePub converters would reject it as well.



For what it's worth, really solving the problem of footnotes inside
headings (div not allowed inside h2, e.g.) may require enough machinery
to do this too. The div paragraphs inside the footnote (which now has to
be treated as span) won't be permitted either.


What is the difference between div and span in in this case?


Span is more or less allowed everywhere. Of course, span is by default 
inline. But you can get it to act like a div by setting display:block in 
CSS. Cheating, no doubt.


Rethinking how footnotes should be handled is one aspect of the summer's 
GSoC work.


Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Steve Litt
On Thu, 06 Jun 2013 10:33:23 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/06/2013 10:22 AM, Jean-Marc Lasgouttes wrote:
  06/06/2013 16:02, Richard Heck:
  It would be nice to document what the reason really was. I agree
  with Steve that outputting propper HTML is very important, in
  particular if we plan to import it in other formats.
 
  The use of div for paragraphs is not unusual. One sees it quite
  alot on the
  web.
 
  I can also find lots of interesting MSword documenta on the web :)
  It is a matter of semantics
  http://stackoverflow.com/questions/2226562/what-is-the-difference-between-p-and-div
   
 
 
 Yes, I know, but especially with auto-generated documents, the use of 
 p causes problems, which is why people avoid it.
 
 Here's an example of what led to this:
 
 p class=standardThis is a paragraph.div class=footnotep 
 class=standardThis is a footnote./pp class=standardWith two 
 paragraphs./p/div Rest of paragraph./p
 
 That is invalid. Whereas if you replace p with div it is fine.
 
 Again, we could try to detect this, but it's hard to know how to do
 it without making assumptions. What if someone did use div for
 Standard? Then there is nothing to detect.
 
 It starts to feel like we need to code the entire DTD and check 
 everything we do against it.
 
 For what it's worth, really solving the problem of footnotes inside 
 headings (div not allowed inside h2, e.g.) may require enough
 machinery to do this too. The div paragraphs inside the footnote
 (which now has to be treated as span) won't be permitted either.

Thanks Richard,

It all makes perfect sense now. The operative principle here is that the
perfect is the enemy of the good. If the developers had gone for
perfection (use of p instead of div), a converter that handled
multiparagraph footnotes never would have been created, or it would
have taken much longer. I completely understand, having made many such
choices in the past.

It's wonderful that all this can be overridden with layouts or modules
(which I've never used). I'm going to read up on the docs you
recommended, and see if *for my purposes, where I don't use footnotes*,
I can change it to p and map the various styles to h1 through h6.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-06 Thread Steve Litt
On Thu, 06 Jun 2013 10:02:15 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/06/2013 09:54 AM, Jean-Marc Lasgouttes wrote:
  06/06/2013 15:47, Richard Heck:
  That said, the reason it is done this way is because the default
  layout, Standard, is used inside other kinds of things, where p
  would not be allowed. At least, I seem to remember that is why I
  did it that way.
 
  It would be nice to document what the reason really was. I agree
  with Steve that outputting propper HTML is very important, in
  particular if we plan to import it in other formats.
 
 The use of div for paragraphs is not unusual. One sees it quite alot
 on the web. I suppose it would be possible to test, as we do output,
 for the case when we are embedded in some context where p is not
 allowed. That could be filed as a bug.
 
  And what about h1/h2/h3... ?
 
 This was just wrong. h1 is used for both part and chapter, with
 different classes. h2 is used for sections, h3 for subsections, etc.
 See stdsections.inc
 for the details, all of which, again, can be modified via layout.

How would I override the stdsections.inc styles' HTMLTag in my layout?
My layout files don't define styles already given me by LyX's book
style, but instead just add new styles. What would be the quickest,
easiest way within a layout file to modify HTMLTag for Standard, Part,
Section, Subsection, SubSubSection, Paragraph and SubParagraph? Could I
do something like this Assuming starting with the Article document
class and not using Part:

Style Section
  CopyStyle Section
  HTMLTag h1
End

Style Standard
  CopyStyle Standard
  HTMLTag p
End

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Why div in HTML exports instead of p?

2013-06-06 Thread Steve Litt
Hi all,

I decided to try my hand at using LyX to quickly write web pages. When
I converted to either LyXHTML or HTML, the result delineated paragraphs
not with p, but with div. 

That's certainly not how I want my websites to be written. To me, div
is a description of appearance: fingerpainting. To me, p is a
description of functionality, which is what I want.

p can have class=mystyle just like div can, with CSS defining
what mystyle looks like. So I'm not sure what's gained by using div
for all paragraphs.

Similarly, a casual perusal of the output looks to me like all headings
are h1 with different classes part, section, etc. This also casts
aside HTML's natural structure and meanings, keeping the appearance. Of
course, to map part/chapter/section/subsection/subsubsection/paragraph
to HTML's h1 thru h6 would require an outside mapping, but I think
a knowledgeable author could make that mapping in five minutes.

None of this is vital to me. I can always make a Vim script that
replaces div with p, replaces h1 with the proper h? level
depending on the class, etc. I'm just curious why it was chosen, both
by export to HTML and export to LyXHTML, to map to HTML appearance
instead of HTML structure.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 08:34 AM, Steve Litt wrote:

Hi all,

I decided to try my hand at using LyX to quickly write web pages. When
I converted to either LyXHTML or HTML, the result delineated paragraphs
not with p, but with div.

That's certainly not how I want my websites to be written. To me, div
is a description of appearance: fingerpainting. To me, p is a
description of functionality, which is what I want.

p can have class=mystyle just like div can, with CSS defining
what mystyle looks like. So I'm not sure what's gained by using div
for all paragraphs.

Similarly, a casual perusal of the output looks to me like all headings
are h1 with different classes part, section, etc. This also casts
aside HTML's natural structure and meanings, keeping the appearance. Of
course, to map part/chapter/section/subsection/subsubsection/paragraph
to HTML's h1 thru h6 would require an outside mapping, but I think
a knowledgeable author could make that mapping in five minutes.

None of this is vital to me. I can always make a Vim script that
replaces div with p, replaces h1 with the proper h? level
depending on the class, etc. I'm just curious why it was chosen, both
by export to HTML and export to LyXHTML, to map to HTML appearance
instead of HTML structure.


Almost all such things can be modified via layout. In this case:
Style Standard
HTMLTag p
End
Put it in local layout, a module, whatever you want, and more generally
see section 5.4 of the Customization manual.

That said, the reason it is done this way is because the default layout,
Standard, is used inside other kinds of things, where p would not be
allowed. At least, I seem to remember that is why I did it that way. There
is actually a similar problem now with footnotes, which are formatted
via div, which is not allowed, e.g., in a heading.

Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Jean-Marc Lasgouttes

06/06/2013 15:47, Richard Heck:

That said, the reason it is done this way is because the default
layout, Standard, is used inside other kinds of things, where p
would not be allowed. At least, I seem to remember that is why I did
it that way.


It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.

And what about h1/h2/h3... ?

JMarc


Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 09:54 AM, Jean-Marc Lasgouttes wrote:

06/06/2013 15:47, Richard Heck:

That said, the reason it is done this way is because the default
layout, Standard, is used inside other kinds of things, where p
would not be allowed. At least, I seem to remember that is why I did
it that way.


It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.


The use of div for paragraphs is not unusual. One sees it quite alot on the
web. I suppose it would be possible to test, as we do output, for the case
when we are embedded in some context where p is not allowed. That could
be filed as a bug.


And what about h1/h2/h3... ?


This was just wrong. h1 is used for both part and chapter, with different
classes. h2 is used for sections, h3 for subsections, etc. See 
stdsections.inc

for the details, all of which, again, can be modified via layout.

Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Jean-Marc Lasgouttes

06/06/2013 16:02, Richard Heck:

It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.


The use of div for paragraphs is not unusual. One sees it quite alot on the
web.


I can also find lots of interesting MSword documenta on the web :) It is 
a matter of semantics

http://stackoverflow.com/questions/2226562/what-is-the-difference-between-p-and-div

[do philosophers care about semantics?]


And what about h1/h2/h3... ?


This was just wrong. h1 is used for both part and chapter, with different
classes. h2 is used for sections, h3 for subsections, etc. See
stdsections.inc
for the details, all of which, again, can be modified via layout.


Good.

JMarc



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 10:22 AM, Jean-Marc Lasgouttes wrote:

06/06/2013 16:02, Richard Heck:

It would be nice to document what the reason really was. I agree with
Steve that outputting propper HTML is very important, in particular if
we plan to import it in other formats.


The use of div for paragraphs is not unusual. One sees it quite alot 
on the

web.


I can also find lots of interesting MSword documenta on the web :) It 
is a matter of semantics
http://stackoverflow.com/questions/2226562/what-is-the-difference-between-p-and-div 



Yes, I know, but especially with auto-generated documents, the use of 
p causes problems, which is why people avoid it.


Here's an example of what led to this:

p class=standardThis is a paragraph.div class=footnotep 
class=standardThis is a footnote./pp class=standardWith two 
paragraphs./p/div Rest of paragraph./p


That is invalid. Whereas if you replace p with div it is fine.

Again, we could try to detect this, but it's hard to know how to do it 
without making assumptions. What if someone did use div for Standard? 
Then there is nothing to detect.


It starts to feel like we need to code the entire DTD and check 
everything we do against it.


For what it's worth, really solving the problem of footnotes inside 
headings (div not allowed inside h2, e.g.) may require enough machinery 
to do this too. The div paragraphs inside the footnote (which now has to 
be treated as span) won't be permitted either.


Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Jean-Marc Lasgouttes

06/06/2013 16:33, Richard Heck:

Here's an example of what led to this:

p class=standardThis is a paragraph.div class=footnotep
class=standardThis is a footnote./pp class=standardWith two
paragraphs./p/div Rest of paragraph./p

That is invalid. Whereas if you replace p with div it is fine.


Which p? The inner one?


Again, we could try to detect this, but it's hard to know how to do it
without making assumptions. What if someone did use div for Standard?
Then there is nothing to detect.

It starts to feel like we need to code the entire DTD and check
everything we do against it.


This is not nice indeed.


For what it's worth, really solving the problem of footnotes inside
headings (div not allowed inside h2, e.g.) may require enough machinery
to do this too. The div paragraphs inside the footnote (which now has to
be treated as span) won't be permitted either.


What is the difference between div and span in in this case?

JMarc



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Richard Heck

On 06/06/2013 12:21 PM, Jean-Marc Lasgouttes wrote:

06/06/2013 16:33, Richard Heck:

Here's an example of what led to this:

p class=standardThis is a paragraph.div class=footnotep
class=standardThis is a footnote./pp class=standardWith two
paragraphs./p/div Rest of paragraph./p

That is invalid. Whereas if you replace p with div it is fine.


Which p? The inner one?


Yes. No p inside p. Most browsers will allow it, but when Firefox is 
in a strict XHTML mode, it simply refuses to load the document. And you 
have to be in that mode, in Firefox, at least, in order to use MathML. I 
suspect that the ePub converters would reject it as well.



For what it's worth, really solving the problem of footnotes inside
headings (div not allowed inside h2, e.g.) may require enough machinery
to do this too. The div paragraphs inside the footnote (which now has to
be treated as span) won't be permitted either.


What is the difference between div and span in in this case?


Span is more or less allowed everywhere. Of course, span is by default 
inline. But you can get it to act like a div by setting display:block in 
CSS. Cheating, no doubt.


Rethinking how footnotes should be handled is one aspect of the summer's 
GSoC work.


Richard



Re: Why div in HTML exports instead of p?

2013-06-06 Thread Steve Litt
On Thu, 06 Jun 2013 10:33:23 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/06/2013 10:22 AM, Jean-Marc Lasgouttes wrote:
  06/06/2013 16:02, Richard Heck:
  It would be nice to document what the reason really was. I agree
  with Steve that outputting propper HTML is very important, in
  particular if we plan to import it in other formats.
 
  The use of div for paragraphs is not unusual. One sees it quite
  alot on the
  web.
 
  I can also find lots of interesting MSword documenta on the web :)
  It is a matter of semantics
  http://stackoverflow.com/questions/2226562/what-is-the-difference-between-p-and-div
   
 
 
 Yes, I know, but especially with auto-generated documents, the use of 
 p causes problems, which is why people avoid it.
 
 Here's an example of what led to this:
 
 p class=standardThis is a paragraph.div class=footnotep 
 class=standardThis is a footnote./pp class=standardWith two 
 paragraphs./p/div Rest of paragraph./p
 
 That is invalid. Whereas if you replace p with div it is fine.
 
 Again, we could try to detect this, but it's hard to know how to do
 it without making assumptions. What if someone did use div for
 Standard? Then there is nothing to detect.
 
 It starts to feel like we need to code the entire DTD and check 
 everything we do against it.
 
 For what it's worth, really solving the problem of footnotes inside 
 headings (div not allowed inside h2, e.g.) may require enough
 machinery to do this too. The div paragraphs inside the footnote
 (which now has to be treated as span) won't be permitted either.

Thanks Richard,

It all makes perfect sense now. The operative principle here is that the
perfect is the enemy of the good. If the developers had gone for
perfection (use of p instead of div), a converter that handled
multiparagraph footnotes never would have been created, or it would
have taken much longer. I completely understand, having made many such
choices in the past.

It's wonderful that all this can be overridden with layouts or modules
(which I've never used). I'm going to read up on the docs you
recommended, and see if *for my purposes, where I don't use footnotes*,
I can change it to p and map the various styles to h1 through h6.

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Re: Why div in HTML exports instead of p?

2013-06-06 Thread Steve Litt
On Thu, 06 Jun 2013 10:02:15 -0400
Richard Heck rgh...@lyx.org wrote:

 On 06/06/2013 09:54 AM, Jean-Marc Lasgouttes wrote:
  06/06/2013 15:47, Richard Heck:
  That said, the reason it is done this way is because the default
  layout, Standard, is used inside other kinds of things, where p
  would not be allowed. At least, I seem to remember that is why I
  did it that way.
 
  It would be nice to document what the reason really was. I agree
  with Steve that outputting propper HTML is very important, in
  particular if we plan to import it in other formats.
 
 The use of div for paragraphs is not unusual. One sees it quite alot
 on the web. I suppose it would be possible to test, as we do output,
 for the case when we are embedded in some context where p is not
 allowed. That could be filed as a bug.
 
  And what about h1/h2/h3... ?
 
 This was just wrong. h1 is used for both part and chapter, with
 different classes. h2 is used for sections, h3 for subsections, etc.
 See stdsections.inc
 for the details, all of which, again, can be modified via layout.

How would I override the stdsections.inc styles' HTMLTag in my layout?
My layout files don't define styles already given me by LyX's book
style, but instead just add new styles. What would be the quickest,
easiest way within a layout file to modify HTMLTag for Standard, Part,
Section, Subsection, SubSubSection, Paragraph and SubParagraph? Could I
do something like this Assuming starting with the Article document
class and not using Part:

Style Section
  CopyStyle Section
  HTMLTag h1
End

Style Standard
  CopyStyle Standard
  HTMLTag p
End

Thanks,

SteveT

Steve Litt*  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance