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: [docbook-apps] EPUB: suppress one chapter from the navigation document -- how?


Hi Robert,

The epub3 stylesheet imports the xhtml5 stylesheet which uses the xhtml stylesheet as its base. The templates in xhtml/autotoc.xsl generate that viewable table of contents nav document.Â

The template named 'toc.line' is called just after the <li> element, so it could be used to generate the hidden="" on the <li> element if you output the attribute immediately in toc.line before any other output. So change that template to start like this:

<xsl:template name="toc.line">
 <xsl:param name="toc-context" select="."/>
 <xsl:param name="depth" select="1"/>
 <xsl:param name="depth.from.context" select="8"/>

 <xsl:call-template name="custom.toc.attributes"/>
 ...

And then create a custom template named 'custom.toc.attribute' to generate the hidden attribute:

<xsl:template name="custom.toc.attributes">
 <xsl:choose>
ÂÂÂ <xsl:when test="@xml:id = 'specialcase'">
ÂÂÂÂÂ <xsl:attribute name="hidden"></xsl:attribute>
ÂÂÂ </xsl:when>
 </xsl:choose>
</xsl:template>

The context of toc.line is the current docbook element being processed (such as section), so you can match on its xml:id or some other attribute like role.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net
On 10/31/2018 9:10 PM, Robert Nagle wrote:
I am making an epub file, and on the TOC I want to suppress one or more HTML pages from being listed in the navigation document. (For example, I want the TOC to show CHAPTER 1, CHAPTER 3, .... but have no Chapter 2 entry visible in the TOC navigation document. )Â


There are manual ways to do this. First, I can manually remove the LI item referring to the line I want to suppress. But the better solution is to give the LI item in the TOC navigation document the "hidden=" attribute. http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-xhtml-nav-def-hidden

Has anyone figured out how to do that with docbook/xslt?Â

The use case is that I have some introductory stuff which shouldn't appear in the navigation document on the reading system. (Like a page of blurbs, or a page promoting other titles by that author).Â

Thanks.ÂÂ

--



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