docbook-apps

  • 1.  Webhelp ToC tree depth

    Posted 08-13-2013 00:16
    Hi,
    First off, the WebHelp output is beautiful. Thanks to everyone involved!

    Newbie question: Is there a way to control the depth of webhelp's ToC tree?
    I'd like it to stop at 3 section levels deep, but the toc.section.depth
    parameter doesn't appear to control this. I think I'm looking for something
    equivalent to the htmlhelp.hhc.section.depth parameter that's available in
    the htmlhelp output for controlling the depth of a CHM's ToC.

    Thanks,
    Mark




  • 2.  Re: [docbook-apps] Webhelp ToC tree depth

    Posted 08-13-2013 15:02
    Hi, Mark.

    I'm not a Webhelp expert but I've used it for a while.

    Webhelp generates its TOC using a separate mechanism. It has to
    support the JavaScript for the expanding TOC so it does things in a
    different way than the standard DocBook TOC functions do. I don't
    think the use case you are describing has been included in Webhelp. I
    have never minded having all my section levels in the TOC, even if my
    chunk depth is lower, so I have never thought about it.

    There's a template in webhelp/xsl/webhelp-common.xsl that matches
    elements that would be in a TOC. The mode is "webhelptoc." This
    doesn't feel very elegant but you could try restricting the match
    attribute to sections that have a limited number of section ancestors.
    The start tag of the template is:

    <xsl:template
    match="d:book|d:part|d:reference|d:preface|d:chapter|d:bibliography|d:appendix|d:article|d:topic|d:glossary|d:section[count(ancestor::d:section)
    < 3]|d:simplesect|d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:refentry|d:colophon|d:bibliodiv|d:index|d:setindex"
    mode="webhelptoc">

    I modified the value for d:section in this example. There are two
    other element lists in this template because it seems to call itself
    recursively. I made the same change in both of them. I used the number
    three here because my chunk level is three (the default). The TOC
    would behave very strangely if you restricted the TOC to a shallower
    depth than you are chunking.

    Sounds like a good feature request
    (http://sourceforge.net/p/docbook/feature-requests/).

    Good luck.

    Peter


    On Mon, Aug 12, 2013 at 8:15 PM, Mark Waterman
    <markw@scaleoutsoftware.com> wrote:
    > Hi,
    > First off, the WebHelp output is beautiful. Thanks to everyone involved!
    >
    > Newbie question: Is there a way to control the depth of webhelp's ToC tree?
    > I'd like it to stop at 3 section levels deep, but the toc.section.depth
    > parameter doesn't appear to control this. I think I'm looking for something
    > equivalent to the htmlhelp.hhc.section.depth parameter that's available in
    > the htmlhelp output for controlling the depth of a CHM's ToC.
    >
    > Thanks,
    > Mark
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >