docbook-apps

Re: [docbook] Customizing table of contents in HTML output

  • 1.  Re: [docbook] Customizing table of contents in HTML output

    Posted 10-25-2006 06:54
      |   view attached
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hi Colin,

    I believe the answer is here:
    http://www.sagehill.net/docbookxsl/TOCcontrol.html

    Check the last example: just need to change appendix for chapter, and
    then add the xsl:value of your revnumber instead of the gentext string.

    I think :-)

    Camille.

    Colin Shapiro a écrit :
    > I'd like to generate a table of contents in my HTML output that contains
    > extra information about each chapter of my book. Specifically, I'd like
    > the table of contents to list not only the titles of each chapter, but
    > each chapter's revision.
    >
    > Something resembling the following:
    >
    > DOCUMENT REVISION
    > ----------------------------------------------
    > chapter1title 20061012
    > chapter2title 20050617
    > chapter3title 20060205
    >
    >
    > So, if I were to create the table of contents manually, I'd stick the
    > following table into a preface of my book:
    >
    >
    >
    >
    > <tgroup cols="5">
    >
    > <row>
    > <entry>DOCUMENT</entry>
    > <entry>REVISION</entry>
    > </row>
    >
    >
    > <row>
    > <entry><xi:xinclude></xi:xinclude>
    > href=" chapter1.xml"
    > xpointer="xpointer(/chapter/chapterinfo/title/text())"
    > xmlns:xi="http://www.w3.org/2001/XInclude" /></entry>
    > <entry><xi:xinclude></xi:xinclude>
    > href="chapter1.xml"
    >
    > xpointer="xpointer(/chapter/chapterinfo/revhistory/revision[position=last()]/revnumber/text())"
    > xmlns:xi="http://www.w3.org/2001/XInclude
    > <http: www.w3.org/2001/xinclude="">" /></http:></entry>
    > </row>
    >
    > </tgroup>
    >

    >
    >
    > In this manner, I could manually create a table of contents in the
    > format I wanted. But what if I'd rather do this with an XSL
    > customization layer, so that the whole table of contents would be
    > generated automatically?
    >
    > Can anyone point me in the right direction? I understand how to make
    > basic customization layers, but I've never done anything this complex.
    >
    > Thanks for any input you may offer.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)
    Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

    iD8DBQFFPwoJjv9P65BfOUMRApnBAKCSkTLIv9Yi9ca3Jm0S3VU1gqMM9gCeLY/c
    VL5uQ/O4+ryDjUyISwS/qik=
    =DYYw
    -----END PGP SIGNATURE-----

    Attachment(s)

    vcf
    camille.vcf   472 B 1 version