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] How to make refentries show up in the TOC



On Dec 2, 2005, at 7:11 AM, Markus Hoenicka wrote:

> Hi,
>
> I'm exploring ways to generate both parts of the manual and the man  
> pages of a
> software project from the same DocBook sources. I've used doclifter  
> to create a
> DocBook XML representation of the man pages. After integrating them  
> into the
> manual I noticed that the refentries do not show up in the TOC.  
> E.g. I had a
> chapter about doing foo which requires two scripts. These were  
> described in two
> sect1. The TOC was something like:
>
> Doing Foo
>   Script 1
>   Script 2
>
> When I replace the sections with the corresponding refentries, The  
> TOC only
> contains the "Doing Foo" entry, making the manual far less  
> accessible for
> users.

I had a similar problem.  I wanted each section that contained  
refentries to have its own table of contents listing the refentries.   
What I did was to give each such section a role="reference"  
attribute, and put this template in my customization layer:

   <!-- This is a modified version of the "section" template that
        always builds a table of contents. -->
   <xsl:template match="section[@role='reference']">
     <xsl:variable name="depth" select="count(ancestor::section)+1"/>

     <xsl:call-template name="id.warning"/>

     <xsl:variable name="toc.params">
       <xsl:call-template name="find.path.params">
         <xsl:with-param name="table" select="normalize-space 
($generate.toc)"/>
       </xsl:call-template>
     </xsl:variable>

     <div class="{name(.)}">
       <xsl:call-template name="dir">
         <xsl:with-param name="inherit" select="1"/>
       </xsl:call-template>
       <xsl:call-template name="language.attribute"/>
       <xsl:call-template name="section.titlepage"/>

       <xsl:call-template name="section.toc">
         <xsl:with-param name="toc.title.p" select="contains 
($toc.params, 'title')"/>
       </xsl:call-template>
       <xsl:call-template name="section.toc.separator"/>

       <xsl:apply-templates/>
       <xsl:call-template name="process.chunk.footnotes"/>
     </div>
   </xsl:template>

Does that help?  I don't get the refentries listed in the top level  
toc, but I don't want them there.

   -- Steve


--
-- EMail: stephen.langer@nist.gov                    Phone: (301)  
975-5423 --
-- WWW:  http://math.nist.gov/mcsd/Staff/SLanger/    Fax:   (301)  
990-4127 --
-- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md   
20899-8910 --

-- "I don't think this will work.  That's why it's  
science."               --
--                                      Naomi Langer,  17 Feb  
2003         --




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