forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: Question: how to enable document section numbering?
Date Wed, 08 Dec 2004 17:14:48 GMT
Please attache this to an issue on the issue tracker, it is likely to 
get lost in the mail lists.

http://issues.cocoondev.org/secure/CreateIssue!default.jspa

Oh, and thanks for your contribution - very valuable.

Ross


Jacques, Olivier (OCBU-Test Infra) wrote:
> 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&lt;//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>
> 
> 

Mime
View raw message