OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: Reasoning behind epub <h> level numbering


With regard to this problem, I wrote this description of how I solved
it last year. It probably is not the ideal solution, but it worked for
me..... Hopefully the epub3 won't have this problem (and Kindle Fire
won't have it).  The main reason it mattered was that Kindle 3 and
below only did styling for H tags.

rj



Because of a Docbook bug, chapters and sections and subsections are
all h1. This is bad for Kindle format (i.e., Kindle 3)  because that
is the only way to contrast headings. Kindle can only differentiate
between h1, h2, h3 and not h1.chapter, h1.section, h1.subsection.

I have noticed that when you use the epub/docbook.xsl stylesheet,  by
default epub output shows h1 for both  chapters and sections (which is
bad).  Sections are supposed to output h2, subsections as h3, etc.
With epub output, this problem is not so bad because you can create a
css rule for div.chapter and div.section, but still that is not right.
 I think there is a bug in epub/docbook.xsl which causes this.  To fix
this, I copied the entire contents of  the code inside and including
<xsl:template name="section.heading">from epub/docbook.xsl into my XSL
customization layer and simply edited one line:


<xsl:variable name="hlevel">
<xsl:choose>
<!-- highest valid HTML H level is H6; so anything nested deeper than
7 levels down just becomes H6
 Note from Robert: I added + 1 on the xsl: otherwise statement-->
 <xsl:when test="$level &gt; 6">6</xsl:when> <xsl:otherwise>
<xsl:value-of select="$level+1"/> </xsl:otherwise> </xsl:choose>
</xsl:variable>



-- 
Robert Nagle
6121 Winsome Ln #56C, Houston TX 77057-5581
(H) 713 893 3424/ (W) 832-251-7522 Carbon Neutral Since Jan 2010
http://www.robertnagle.info


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]