This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] simplesect out of TOC


Bob,

Actually, I see now that this is the same as the problem reported
in bug #1046947 (Wrong TOC entry for <simplesect>).

  https://sourceforge.net/tracker/index.php?func=detail&aid=1046947&group_id=21935&atid=373747

  there exists no template rule for simplesect elements
  in mode "toc", which results in output of all text
  descendant nodes of the simplesect element in the TOC entry.

That got broken in v1.66.0 when simplesect was added to the set of
elements whose content gets selected by the subtoc named template.
But the changes you checked in this week un-broke it.

However, note that Norm posted a comment to bug #1046947 saying:

  Simplesect elements aren't supposed to appear in the ToC at
  all. Ugh. The Definitive Guide doesn't really explain that
  very well.

  The use case for simplesect is when, for example, every
  chapter in a book ends with "Exercises" or "For More
  Information" sections and you don't want those to appear in
  the ToC.

So simplesect was not being included in the TOC _by design_.

(Though, actually, TDG not only doesn't explain that very well; it
doesn't explain it at all.)

That said, there may be some users who have been using simplesect
in the way that Norm describes and who won't want their
simplesects to appear in the TOC. On the other hand, there are
probably a lot that do want simplesect in the TOC.

So, I have filed a feature request proposing that we add a new
simplesect.in.toc parameter (similar to the bridgehead.in.toc
param). For backward compatibility, I think the default value
should be 0, indicating that simplesect is not included in TOCs.
Users who want to include it will need to set the value to 1.

Bob, if that all sounds OK, please let me know, and I will go
ahead and make the code change and write up the reference doc and
check it all in.

  --Mike

Bob Stayton <bobs@sagehill.net> writes:

> > I think the most easier way is to use
> > <xsl:template match="simplesect[@role = 'NotInToc']" mode="toc">
> > , but it did not work, so why?
> 
> Hi,
> Actually, that method did work for me when I made the above template empty
> and added a role="NotInToc" to the simplesect element.  I don't know why it
> didn't work for you.
> 
> While investigating this, though, I discovered two bugs in html/autotoc.xsl
> regarding how simplesect was being handled in the HTML TOCs.  I don't think
> my fixes will affect your problem, though.  One fix added a
> match="simplesect" mode="toc" template, which was missing.  Because it was
> missing, the processor was using the default template and descending to the
> simplesect *children* and processing them in mode="toc".  That produced junk
> after the simplesect title in the table of contents.  The other fix added
> simplesect to the list of children that should appear in a component TOC
> (chapter, appendix).  That was missing as well.
> 
> Bob Stayton
> Sagehill Enterprises
> DocBook Consulting
> bobs@sagehill.net
> 
> 
> ----- Original Message ----- 
> From: "Cai Qian" <caiqian@gnome.org>
> To: "Docbook-apps" <docbook-apps@lists.oasis-open.org>
> Sent: Friday, November 12, 2004 9:50 AM
> Subject: Re: [docbook-apps] simplesect out of TOC
> 
> 
> > On Fri, 2004-11-12 at 08:56 -0800, Bob Stayton wrote:
> > > Hi,
> > > You want to customize this template from html/autotoc.xsl:
> > >
> > > <xsl:template match="preface|chapter|appendix|article" mode="toc">
> > >   <xsl:param name="toc-context" select="."/>
> > >
> > >   <xsl:call-template name="subtoc">
> > >     <xsl:with-param name="toc-context" select="$toc-context"/>
> > >     <xsl:with-param name="nodes"
> select="section|sect1|simplesect|refentry
> > >                                          |glossary|bibliography|index
> > >                                          |bridgehead[$bridgehead.in.toc
> !=
> > > 0]"/>
> > >   </xsl:call-template>
> > > </xsl:template>
> > >
> > I think the most easier way is to use
> > <xsl:template match="simplesect[@role = 'NotInToc']" mode="toc">
> > , but it did not work, so why?
> > >
> > >
> > > ----- Original Message ----- 
> > > From: "Cai Qian" <caiqian@gnome.org>
> > > To: "Docbook-apps" <docbook-apps@lists.oasis-open.org>
> > > Sent: Friday, November 12, 2004 8:23 AM
> > > Subject: [docbook-apps] simplesect out of TOC
> > >
> > >
> > > > Hi,
> > > > I have a documents,
> > > > <book>
> > > >   <appendix>
> > > >     <title>GFDL</title>
> > > >     <simplesect>
> > > >       <title>PREAMBLE</title>
> > > >       <para>...</para>
> > > >
> > > > When I transform that into HTML, it seems that everything in
> simplesect
> > > > is into TOC. I used following
> > > >
> > > >   <xsl:template match="simplesect" mode="toc">
> > > >     <xsl:param name="toc-context" select="."/>
> > > >
> > > >     <xsl:call-template name="subtoc">
> > > >       <xsl:with-param name="toc-context" select="$toc-context"/>
> > > >     </xsl:call-template>
> > > >   </xsl:template>
> > > >
> > > > to avoid it, but it has no effect on title in simplesect. So Is there
> a
> > > > better way to solve this problem?
> > > >
> > > > Thanks,
> > > > -- 
> > > > Cai Qian
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > -- 
> > Cai Qian
> >
> >
> >
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]