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] 5 Questions: from PHP tags to XIncludes

----- Original Message ----- 
From: "Frans Englich" <frans.englich@telia.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Friday, July 23, 2004 11:52 PM
Subject: [docbook-apps] 5 Questions: from PHP tags to XIncludes

> 3. Skipping TOCs in sections
> My project is a book, but simultaneously are the sections(sect1) shown
> independently on a website as "articles". Some of these are too small for
> having a TOC. While I need to have sections and so forth, the TOC is
> sometimes overkill. How can I specify in the sect1 to not have a TOC? (or
> some other object oriented solution, I want my driver to be generic)

For cases where you need special exceptions, a processing instruction can be
used.  If you add something like this to those sections whose TOC you want
to omit:

    <section id="c2s2">
      <?dbhtml omit-toc="1"?>
       <title>Section test</title>

And then customize the template named 'section.toc' by adding something like
this to your customization file:

<xsl:template name="section.toc">
  <xsl:param name="toc-context" select="."/>
  <xsl:param name="toc.title.p" select="true()"/>

  <xsl:param name="omit-toc">
    <xsl:call-template name="dbhtml-attribute">
      <xsl:with-param name="pis"
      <xsl:with-param name="attribute" select="'omit-toc'"/>

  <xsl:if test="$omit-toc != '1'">
    <xsl:call-template name="make.toc">
      <xsl:with-param name="toc-context" select="$toc-context"/>
      <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
      <xsl:with-param name="nodes"
                             |bridgehead[$bridgehead.in.toc != 0]"/>

It first fetches any value of the PI as a child of the current section
element, then uses that value to decide if it should call 'make.toc'.

BTW, I don't know about others, but I prefer to see one question per message
with a good subject line.  When people look in the list archive, then they
can find something based on the subject lines.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

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