forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Gardler (JIRA)" <j...@apache.org>
Subject [jira] Updated: (FOR-411) Section numbering in HTML output
Date Tue, 03 Oct 2006 19:22:23 GMT
     [ http://issues.apache.org/jira/browse/FOR-411?page=all ]

Ross Gardler updated FOR-411:
-----------------------------

    Other Info:   (was: [Patch available])

The likelyhood of getting this into 0.8 will be massively increased if someone can create
a proper patch which means a committer can make the necessary changes by running a single
command rather than having to hunt through files and manually edit.

A further potential problem for people is that the solution provided is described as "a partial
solution (on top of 0.6):" We need a complete solution against 0.8-dev.

The other option is to wait until a committer actually needs this functionality and then they
will do the work for themselves.

> Section numbering in HTML output
> --------------------------------
>
>                 Key: FOR-411
>                 URL: http://issues.apache.org/jira/browse/FOR-411
>             Project: Forrest
>          Issue Type: Improvement
>          Components: Core operations
>    Affects Versions: 0.8-dev
>            Reporter: Olivier Jacques
>
> Section numbering is enabled for document rendered in PDF, but not for HTML (tigris skin).
> I would like to get auto-numbering for section headers:
> 1. Section1
>     1.1 Section1.1
>     1.2 Section1.2
> 2. Section2
> Here is a partial solution (on top of 0.6):
> - First, modification of skinconf.xml to have numbers in the TOC (new attribute: 'with-numbers'):
>   <!-- 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>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message