Looks good.
Now I'm trying my luck here:
Can we get letters in the TOC numbering? My manuals have appendices, and
appendix section numbers are of the form A.1.1, B.3.2 etc. In note the
"format="1.1.1.1.1.1"" attribute, which invites the question: would
"format="A.1.1.1.1.1.1" do the job?
In which case the issue would be how to specify (in site.xml) which
documents were to use the appendix numbering style....
Charles
----- Original Message -----
From: "Jacques, Olivier (OCBU-Test Infra)" <olivier.jacques@hp.com>
To: <user@forrest.apache.org>
Sent: Wednesday, December 08, 2004 4:28 PM
Subject: RE: Question: how to enable document section numbering?
Jacques, Olivier (OCBU-Test Infra) <> wrote:
> Thanks, I finally figure out how to do. I'm about to provide
> a patch with parameters in skinconf.xml.
Here it is (on top of 0.6):
- First, modification of skinconf.xml to have numbers in the TOC:
<!-- Configure the TOC, i.e. the Table of Contents.
@max-depth
how many "section" levels need to be included in the
generated Table of Contents (TOC).
@min-sections
Minimum required to create a TOC.
@location ("page","menu","page,menu", "none")
Where to show the TOC.
@with-numbers
Wether to enable TOC auto-numbering
-->
<toc max-depth="3" min-sections="1" location="page"
with-numbers="true"/>
- Numbers in the TOC is handled in site2xhtml.xsl:
$ diff -bruN site2xhtml.xsl.orig site2xhtml.xsl
--- site2xhtml.xsl.orig 2004-10-10 14:04:50.000000000 +0200
+++ site2xhtml.xsl 2004-12-08 15:35:52.309861500 +0100
@@ -294,6 +294,9 @@
<xsl:for-each select="$tocroot/tocitem">
<li>
<a href="{@href}">
+ <xsl:if
test="contains($config/toc/@with-numbers,'true')">
+ <xsl:number count="tocitem" format="1.1.1.1.1.1.1"
level="multiple" />.
+ </xsl:if>
<xsl:value-of select="@title"/>
</a>
<xsl:if test="@level<//skinconfig/toc/@max-depth+1">
- Numbers in the document itself is handled in document2html.xsl.
Unfortunately, I was unable to retrieve a configuration value (like a
did for site2xhtml) from within document2html.xsl. The idea I had was to
add an attribute in skinconf's <headings type="boxed" />. Here is an
"hardcoded" version anyway:
$ diff -bruN document2html.xsl.orig document2html.xsl
--- document2html.xsl.orig 2004-10-10 14:05:04.000000000 +0200
+++ document2html.xsl 2004-12-08 16:50:17.974008600 +0100
@@ -129,13 +131,20 @@
<xsl:choose>
<xsl:when test="$level=1">
<div class="h3">
- <h3><xsl:value-of select="title"/></h3>
+
+ <h3>
+ <xsl:number count="section" format="1.1.1.1.1.1.1"
level="multiple" />.
+ <xsl:value-of select="title"/>
+ </h3>
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:when test="$level=2">
<div class="h4">
- <h4><xsl:value-of select="title"/></h4>
+ <h4>
+ <xsl:number count="section" format="1.1.1.1.1.1.1"
level="multiple" />.
+ <xsl:value-of select="title"/>
+ </h4>
<xsl:apply-templates select="*[not(self::title)]"/>
</div>
@@ -149,13 +158,19 @@
</div>
</xsl:when>
<xsl:when test="$level=3">
- <h4><xsl:value-of select="title"/></h4>
+ <h4>
+ <xsl:number count="section" format="1.1.1.1.1.1.1"
level="multiple" />.
+ <xsl:value-of select="title"/>
+ </h4>
<xsl:apply-templates select="*[not(self::title)]"/>
</xsl:when>
<xsl:otherwise>
- <h5><xsl:value-of select="title"/></h5>
+ <h5>
+ <xsl:number count="section" format="1.1.1.1.1.1.1"
level="multiple" />.
+ <xsl:value-of select="title"/>
+ </h5>
<xsl:apply-templates select="*[not(self::title)]"/>
</xsl:otherwise>
|