[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: re: Subject: docbook.xsl and epub indexing
You might find my ongoing guide of docbook-epub tricks to be helpful (though it's not well-organized) http://www.imaginaryplanet.net/weblogs/idiotprogrammer/2010/11/ebookepub-production-secrets-tips-tricks/ There is a parameter index.links.to.section which lets you link to a specific part of the page http://docbook.sourceforge.net/release/xsl/current/doc/html/index.links.to.section.html . But I found a kind of bug in that: Here's what I wrote about indices and epub: HTML indices for Docbook don’t use page numbers, but indicate the section title. That can be cumbersome. The solution is (for now) to give a titleabbrev element for every title and then prevent the TOC builder from using the titleabbrev in the TOC instead of the original title. Until there is a parameter to disable this, you can customize the template named ‘toc.line’ in html/autotoc.xsl to change <xsl:apply-templates mode="titleabbrev.markup" select="." /> to <xsl:apply-templates select="." mode="title.markup"/> Now that I look at this more closely, I see that the epub stylesheet uses xhtml-1.1, so the proper file to edit would be xhtml-1_1/autotoc.xsl. HTML indices in epub don’t work well when you use a SECONDARY element under INDEXTERM element (i.e., most of the time). index.links.to.section determines whether the index link will go to the exact place in the section or simply to the top of the section. The default value for this parameter is 1 (which means the link will go to the section and not the exact location). Unfortunately, changing it to 0 will make the link go specifically to the specific location in the text; however, it will create duplicate links in the index: one to the value of the PRIMARY element, and the other to the value of the SECONDARY element. I ended up leaving the value of this parameter to the default (i.e, 0) and indicating on the heading of the index that it will go to the section, not the exact place. “Topics, listed by Chapter & Section”. Another option is to not use the SECONDARY value at all and change the parameter value to 1. It’s a tradeoff. (More about this bug https://sourceforge.net/tracker/index.php?func=detail&aid=3202612&group_id=21935&atid=373747 ). 4/1/2011 Update. When you convert from epub-to-Kindle, kindlegen massacres the index. It cannot process the secondary element only the primary element; it can only deal with one level of index terms. I think it relates to the way Kindle handles definition lists. ************************************************** Subject: docbook.xsl and epub indexing From: Michael McLoughlin <michaelmclo@gmail.com> To: docbook-apps@lists.oasis-open.org Date: Fri, 9 Sep 2011 13:56:37 -0400 I transformed a docbook to epub using docbook.xsl, which went very well using python and LXML (I am new to all of this). The index points to chapter headings (how useful is that?). Is there a way to revise the XSL to have the index point to the location in the text? -- MMcLoughlin -- 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]