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] Section[1] only in toc


Hi Peter,

This is what I would try (I haven't tested it, so let me know if it doesn't work).

In fo/autotoc.xsl, elements for a TOC are selected as a set of $nodes and then those nodes are processed in mode="toc". In those templates, each line in the toc is generated by calling the template named "toc.line". This template handles an article:

<xsl:template match="preface|chapter|appendix|article" mode="toc">

You can create a custom template that matches on only "article" that removes the call to "toc.line" and processes the top-level sections in a for-each loop:

<xsl:for-each select="d:section">
ÂÂ <xsl:call-template name="toc.line">
ÂÂÂÂÂ <xsl:with-param name="toc-context" select="$toc-context"/>
 </xsl:call-template>
</xsl:for-each>

The "toc.line" template does not process any subsections.

Bob Stayton
bobs@sagehill.net
On 4/1/2020 2:05 AM, Peter Fleck wrote:
Yes, sorry FO, I know I can use a manual.toc for HTML.

Thanks,

Peter

On Tue, 31 Mar 2020 at 23:27, Bob Stayton <bobs@sagehill.net> wrote:

You didn't mention whether this was for FO or HTML type of output.

Bob Stayton
bobs@sagehill.net
On 3/31/2020 2:08 PM, Peter Fleck wrote:
I have an abnormalÂuse case.

The source file is a book with many articles, however the TOC is to be first level sections of each article and not the article title itself.

Example:

<article>
<info><title></info>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â-- not included
<section><info><title></info></section>Â Â Â-- included
<section><info><title></info></section>Â Â Â-- included
...
</article>
<article>
<info><title></info>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â-- not included
<section><info><title></info></section>Â Â Â-- included
<section><info><title></info></section>Â Â Â-- included
...
</article>

Any pointers would be appreciated.

Thanks,

Peter


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