Re: [docbook-apps] epub/chunking : why h1 tags for sections instead of H2? (solved)
Good news. I think the answer lies in what you said. First, about that comment, it did not make much sense to me -- if only because epub/docbook.xsl also has the section.heading template in docbook.xsl file. Then I realized it is saying that epub/docbook.xsl is overriding what is in section.heading Second, I was confused about the hlevel vs. level variable. Third, I had gotten momentarily confused about which stylesheet I was referencing, but I figured that out. In epub/docbook.xsl I made this one line revision inside the section.heading template to add +1 to the level. By the way, perhaps this is a bug and should have always been +1? rj OLD xsl:variable name=hlevel xsl:choose !-- highest valid HTML H level is H6; so anything nested deeper than 7 levels down just becomes H6 -- xsl:when test=$level gt; 66/xsl:when xsl:otherwise xsl:value-of select=$level/ /xsl:otherwise /xsl:choose /xsl:variable NEW: xsl:variable name=hlevel xsl:choose !-- highest valid HTML H level is H6; so anything nested deeper than 7 levels down just becomes H6 -- xsl:when test=$level gt; 66/xsl:when xsl:otherwise xsl:value-of select=$level+1/ *my change /xsl:otherwise /xsl:choose /xsl:variable The results: book = h1 chapter = h1 section = h2 section = h3 On Tue, Mar 15, 2011 at 10:55 AM, Keith Fahlgren abdela...@gmail.com wrote: Have you reviewed this template in epub/docbook.xsl? !-- Change section.heading to improve SEO on generated HTML by doing heading levels correctly. SEO rules are sometimes silly silly, but this does actually create a semantic improvement. Note: This template needs to be manually maintained outside of the html/sections.xsl code, so make sure important changes get reintegrated. -- xsl:template name=section.heading Keith On Tue, Mar 15, 2011 at 10:55 AM, Keith Fahlgren abdela...@gmail.com wrote: Have you reviewed this template in epub/docbook.xsl? !-- Change section.heading to improve SEO on generated HTML by doing heading levels correctly. SEO rules are sometimes silly silly, but this does actually create a semantic improvement. Note: This template needs to be manually maintained outside of the html/sections.xsl code, so make sure important changes get reintegrated. -- xsl:template name=section.heading Keith -- Robert Nagle 12777 Ashford Point Dr #1417 Houston, Texas 77082 713 893 3424 http://www.robertnagle.info - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] epub/chunking : why h1 tags for sections instead of H2? (solved)
Hi, On Tue, Mar 15, 2011 at 9:51 AM, Robert Nagle idiotprogram...@gmail.com wrote: In epub/docbook.xsl I made this one line revision inside the section.heading template to add +1 to the level. By the way, perhaps this is a bug and should have always been +1? I think it'll depend on how you chunk the content. For SEO purposes, one and only one h1 per HTML file is desirable. This is tested in the suite: should include one and only one h1 in each HTML file in rendered ePub files for books ...but as you say, there may be other contexts where different heading levels are desirable. Keith - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] epub/chunking : why h1 tags for sections instead of H2? (solved)
Perhaps. But I cannot imagine a case when you are using the epub stylesheets, you want to produce an epub file and you would NOT want chapters/sections/subsections to have descending h tags. Robert On Tue, Mar 15, 2011 at 12:03 PM, Keith Fahlgren abdela...@gmail.com wrote: Hi, On Tue, Mar 15, 2011 at 9:51 AM, Robert Nagle idiotprogram...@gmail.com wrote: In epub/docbook.xsl I made this one line revision inside the section.heading template to add +1 to the level. By the way, perhaps this is a bug and should have always been +1? I think it'll depend on how you chunk the content. For SEO purposes, one and only one h1 per HTML file is desirable. This is tested in the suite: should include one and only one h1 in each HTML file in rendered ePub files for books ...but as you say, there may be other contexts where different heading levels are desirable. Keith -- Robert Nagle 12777 Ashford Point Dr #1417 Houston, Texas 77082 713 893 3424 http://www.robertnagle.info - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] epub/chunking : why h1 tags for sections instead of H2? (solved)
Interesting. Let me say that when you chunk by chapter, the chapter should be h1, but the section or sect1 should be h2. In your ch1.html output example both the chapter and sect1 titles are h1. Even if you talk about SEO, then ch1.html contains multiple H1s (and google doesn't like that). Also, using h1 and h2 is the only way to differentiate chapter and section in an epub destined for Kindle. On Tue, Mar 15, 2011 at 12:44 PM, Keith Fahlgren abdela...@gmail.com wrote: On Tue, Mar 15, 2011 at 10:13 AM, Robert Nagle idiotprogram...@gmail.com wrote: Perhaps. But I cannot imagine a case when you are using the epub stylesheets, you want to produce an epub file and you would NOT want chapters/sections/subsections to have descending h tags. I believe that the stylesheets already do this: book titleHeading Nesting/title chapter id=top titleChTitle/title sect1 id=s1 titleS1Title/title paraFoo/para sect2 id=s2 titleS2Title/title paraBar/para sect3 id=s3 titleS3Title/title paraBax/para /sect3 /sect2 /sect1 /chapter /book That will make the expected EPUB files: OEBPS/index.html ?xml version=1.0 encoding=UTF-8 standalone=no? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd; html xmlns=http://www.w3.org/1999/xhtml; head titleHeading Nesting/title meta name=generator content=DocBook XSL Stylesheets V1.77.0-pre/ /head body div class=book title=Heading Nesting div class=titlepage div div h1 class=titlea id=id36091833/Heading Nesting/h1 /div /div hr/ /div /div /body /html OEBPS/ch01.html ?xml version=1.0 encoding=UTF-8 standalone=no? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd; html xmlns=http://www.w3.org/1999/xhtml; head titleChapter 1. ChTitle/title meta name=generator content=DocBook XSL Stylesheets V1.77.0-pre/ /head body div class=chapter title=Chapter 1. ChTitle div class=titlepage div div h1 class=titlea id=top/Chapter 1. ChTitle/h1 /div /div /div div class=sect1 title=S1Title div class=titlepage div div h1 class=titlea id=s1/S1Title/h1 /div /div /div pFoo/p div class=sect2 title=S2Title div class=titlepage div div h2 class=titlea id=s2/S2Title/h2 /div /div /div pBar/p div class=sect3 title=S3Title div class=titlepage div div h3 class=titlea id=s3/S3Title/h3 /div /div /div pBax/p /div /div /div /div /body /html -- Robert Nagle 12777 Ashford Point Dr #1417 Houston, Texas 77082 713 893 3424 http://www.robertnagle.info - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org