Requirements feasibility plan

On Oct 8th Lee Passey wrote:
4. Book titles should be marked with the <h1> element, "part" titles should be marked with the <h2> element, chapter titles should be marked with the <h3> element, "section" titles should be marked with the <h4> element, and "sub-section" titles should be marked with the <h5> element. If a title is composed of both a main title and a subtitle, the subtitle should be distinguished from the main title by adding "class='subtitle'" as an attribute of the title element. Author's names in book titles should be indicated by <h1 class="author">.
My question is whether writing, for example: <h3>CHAPTER 12</h3> <h3 class="subtitle">"WOULD YOU?"</h3> as I think Lee is suggesting above, has any advantages (or disadvantages) over what I currently do which is: <h3>CHAPTER 12</h3> <div class="chapter-title">"WOULD YOU?"</div> (N.B. I had in any case been thinking of changing what I currently do to: <h3>CHAPTER 12</h3> <div class="h3-title">"WOULD YOU?"</div> largely on the grounds that it seemed more general not to bind by suggestive naming that <h3> be used only for chapters, (although Lee seems to want to do this anyway). As implementing this change entails quite a lot of work, I would appreciate hearing any thoughts anyone has on this possibly rather trivial question. Bob Gibbins

On 10/31/2012 06:13 PM, Robert Gibbins wrote:
On Oct 8th Lee Passey wrote:
4. Book titles should be marked with the<h1> element, "part" titles should be marked with the<h2> element, chapter titles should be marked with the<h3> element, "section" titles should be marked with the<h4> element, and "sub-section" titles should be marked with the<h5> element. If a title is composed of both a main title and a subtitle, the subtitle should be distinguished from the main title by adding "class='subtitle'" as an attribute of the title element. Author's names in book titles should be indicated by<h1 class="author">.
My question is whether writing, for example:
<h3>CHAPTER 12</h3> <h3 class="subtitle">"WOULD YOU?"</h3>
as I think Lee is suggesting above, has any advantages (or disadvantages) over what I currently do which is:
<h3>CHAPTER 12</h3> <div class="chapter-title">"WOULD YOU?"</div>
The first one is horrible. Because HTML infers structure from headings, it says, you have an empty section titled "chapter 12" followed by a section titled "would you?" epubmaker would build 2 toc entries. The second is better, but it says, that the section is titled "Chapter 12". The toc entry would be "Chapter 12" only. The best options is: span.subtitle { display: block; font-size: smaller } <h3>Chapter 12 <span class="subtitle">Would You?</span></h3> Also, books do not always follow the part / chapter / section / subsection / paragraph scheme, so it is stupid to prescribe that h2 should always be used to mark a part, etc. The best option is to enclose the chapter in a div and put a class on the div, while numbering the headings in consecutive order: div.chapter { page-break-before: always } h2 { padding-top: 1em } span.subtitle { display: block; font-size: smaller } <div class="chapter" id="chapter12"> <h2>Chapter 12 <span class="subtitle">Would You?</span></h2> ... </div> Regards -- Marcello Perathoner webmaster@gutenberg.org

On 10/31/2012 11:13 AM, Robert Gibbins wrote:
On Oct 8th Lee Passey wrote:
4. Book titles should be marked with the <h1> element, "part" titles should be marked with the <h2> element, chapter titles should be marked with the <h3> element, "section" titles should be marked with the <h4> element, and "sub-section" titles should be marked with the <h5> element. If a title is composed of both a main title and a subtitle, the subtitle should be distinguished from the main title by adding "class='subtitle'" as an attribute of the title element. Author's names in book titles should be indicated by <h1 class="author">.
My question is whether writing, for example:
<h3>CHAPTER 12</h3> <h3 class="subtitle">"WOULD YOU?"</h3>
as I think Lee is suggesting above, has any advantages (or disadvantages) over what I currently do which is:
<h3>CHAPTER 12</h3> <div class="chapter-title">"WOULD YOU?"</div>
(N.B. I had in any case been thinking of changing what I currently do to:
<h3>CHAPTER 12</h3> <div class="h3-title">"WOULD YOU?"</div>
largely on the grounds that it seemed more general not to bind by suggestive naming that <h3> be used only for chapters, (although Lee seems to want to do this anyway).
As implementing this change entails quite a lot of work, I would appreciate hearing any thoughts anyone has on this possibly rather trivial question.
The CSS specification cautions: <blockquote> CSS gives so much power to the "class" attribute, that authors could conceivably design their own "document language" based on elements with almost no associated presentation (such as DIV and SPAN in HTML) and assigning style information through the "class" attribute. Authors should avoid this practice since the structural elements of a document language often have recognized and accepted meanings and author-defined classes may not. </blockquote> For this reason, among others, I advocate (and practice) never using <div> or <span> for any element for which a reasonable alternative exists. <div> should be a last resort. The DP recommendation, with which I agree, is that e-books should be marked up using CSS in such a way that if style sheets are not supported (as some older e-book software) the presentation of the e-book is still reasonable (even if not optimal). In your current practice, if the user agent did not support style sheets your chapter subtitle would be presentationally indistinguishable from a paragraph. Given my suggestion, it would be presentationally indistinguishable from the main title, which is, I think, a better result. It is also more consistent with the "recognized and accepted meaning" of HTML markup. My proposed rule you quoted above is actually a simplification of what I actually do. My typical practice is to mark a chapter title as: <h3 class="chapter">CHAPTER 12</h3> and to mark a chapter subtitle as: <h3 class="chapter subtitle">"WOULD YOU?"</h3> Parts might be marked as: <h2 class="part">Première Partie</h2> <h2 class="part subtitle">Fantine</h2> If you are diligent about always marking a heading with "class='chapter'" it probably doesn't make a lot of difference which <h?> element you use for chapter titles, but I like the consistency of always knowing which element to use, and to get a consistent look and feel across books, especially when a user agent has an imperfect implementation of style sheets (and they all do). Frankly, I don't particularly object to Marcello's suggestion of <h3 class="chapter">CHAPTER 12<br /><span class="subtitle">"WOULD YOU?"</span></h3> either. It requires a little more understanding of the subtleties of HTML, but it has other advantages. If that were the consensus "best practice" I'd be happy with that.

Just for discussion, it is interesting to note the Chapter Heading markup recommended in DP's new Best Practices document. <h2>CHAPTER II.<br/> <small>UNDER WEIGH.</small></h2> The corresponding CSS might look like this, or similar: h2 { text-align: center; font-weight: normal; line-height: 1.5; }

On 10/31/2012 1:31 PM, don kretz wrote:
Just for discussion, it is interesting to note the Chapter Heading markup recommended in DP's new Best Practices document.
<h2>CHAPTER II.<br/> <small>UNDER WEIGH.</small></h2>
My first reaction to this was that I didn't like it, because <small> is purely presentational and purely presentation markup ought to be avoided (not absolutely avoided, but avoided whenever possible). But I got thinking about my two base principles, which are: 1. HTML should degrade gracefully in the absence of CSS support; and 2. <div> and <span> should be used only when there is no other alternative. So just off the top of my head, how about: <h2 class="chapter">CHAPTER II.<br /> <small class="subtitle">UNDER WEIGH.</small></h2> In this case "class='chapter'" tells everyone that it's the header for a chapter, and should be treated as such, but if you don't understand what a chapter is, just treat it like any other level II header. <small class="subtitle"> would allow a style sheet author to alter the meaning of <small> to be, say, normal size, italic (at least as common for subtitles as smaller size), but if you don't understand CSS then just render it smaller. Does this offend your sense of technical correctness?
The corresponding CSS might look like this, or similar:
What the corresponding CSS might or might not look like is completely irrelevant. The way I like my chapter headings to be displayed is between me and my computer, and is none of your business. If DP will get the markup right, I'll take care of the display, thank you very much.

I think we are losing sight of what at least historically was PG's desire to distribute books "everywhere" and not just on the PG site. If this were to remain a PG goal, and I think it should be, then making mark-up or html PG-specific "just to make epubmaker happy" is a mistake. For a simple example, another way to make an ePUB is to take the submitted HTML code and import it into Sigil and thereby make an ePUB book. Does the HTML being submitted to PG work for this purpose? Nope. Because that HTML contains PG-specific epubmaker-specific hacks which are directly contrary to published standards.
participants (5)
-
don kretz
-
James Adcock
-
Lee Passey
-
Marcello Perathoner
-
Robert Gibbins