forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From che...@apache.org
Subject svn commit: rev 9655 - in xml/forrest/trunk: . src/core/context/resources/schema/relaxng src/core/context/skins/common/xslt/html src/core/fresh-site/src/documentation
Date Sat, 20 Mar 2004 15:52:41 GMT
Author: cheche
Date: Sat Mar 20 07:52:39 2004
New Revision: 9655

Modified:
   xml/forrest/trunk/src/core/context/resources/schema/relaxng/skinconf.rnc
   xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl
   xml/forrest/trunk/src/core/fresh-site/src/documentation/skinconf.xml
   xml/forrest/trunk/status.xml
Log:
Do not create TOC unless it has been define on the skinconf
Change level attribute to max-depth attribute.
Add a min-sections attribute to define a minimun number of sections
before create a toc.



Modified: xml/forrest/trunk/src/core/context/resources/schema/relaxng/skinconf.rnc
==============================================================================
--- xml/forrest/trunk/src/core/context/resources/schema/relaxng/skinconf.rnc	(original)
+++ xml/forrest/trunk/src/core/context/resources/schema/relaxng/skinconf.rnc	Sat Mar 20 07:52:39
2004
@@ -43,7 +43,10 @@
             element year {text}?,                    # Used in Copyright
             element vendor {text}?,                  # Used in Copyright
             trail?,                                  # 'Breadcrumbs' trail in skins that
support it
-            element toc {attribute level {text}, attribute location {string}}?, # toc generation
+            element toc {(attribute max-depth {text}?,
+              attribute min-sections {text}?,
+              attribute location {string})}?,        # toc generation
+
             element headings {attribute type {text}}?, # heading style
             colors?,                                 # colors
             element extra-css {text}?,               # extra css to be included in the CSS
output

Modified: xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl	(original)
+++ xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl	Sat Mar 20
07:52:39 2004
@@ -43,8 +43,6 @@
   <xsl:variable name="disable-print-link" select="$config/disable-print-link"/>
   <!-- If true, an XML link for this page will not be generated -->
   <xsl:variable name="disable-xml-link" select="$config/disable-xml-link"/>  
-  <!-- Get the section depth to use when generating the minitoc (default is 2) -->
-  <xsl:variable name="config-max-depth" select="$config/toc/@level"/>
   <!-- Get the location where to generate the minitoc -->
   <xsl:variable name="minitoc-location" select="$config/toc/@location"/>
   <!-- Whether to obfuscate email links -->
@@ -52,16 +50,6 @@
   <!-- If true, an the images on all external links will not be added -->
   <xsl:variable name="disable-external-link-image" select="$config/disable-external-link-image"/>
 
 
-
-  <xsl:variable name="max-depth">
-    <xsl:choose>
-      <xsl:when test="string-length($config-max-depth)&gt;0">
-        <xsl:value-of select="$config-max-depth"/>
-      </xsl:when>
-      <xsl:otherwise>2</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
   <xsl:param name="dynamic-page" select="'false'"/>  
   <xsl:param name="notoc"/>
   <xsl:param name="path"/>
@@ -175,7 +163,7 @@
   </xsl:template>
   
   <xsl:template match="body">
-    <xsl:if test="$max-depth&gt;0 and not($notoc='true')" >
+    <xsl:if test="$config/toc">
       <xsl:call-template name="minitoc">
         <xsl:with-param name="tocroot" select="."/>
         <xsl:with-param name="depth">1</xsl:with-param>
@@ -362,12 +350,12 @@
   <xsl:template name="minitoc">  
     <xsl:param name="tocroot"/>
     <xsl:param name="depth"/>     
-    <xsl:if test="count($tocroot/section) > 0">
+    <xsl:if test="count($tocroot/section) >= $config/toc/@min-sections">
       <ul class="minitoc">
         <xsl:for-each select="$tocroot/section">
           <li>
             <xsl:call-template name="toclink"/>
-            <xsl:if test="$depth&lt;$max-depth">
+            <xsl:if test="$depth&lt;$config/toc/@max-depth">
               <xsl:call-template name="minitoc">
                 <xsl:with-param name="tocroot" select="."/>
                 <xsl:with-param name="depth" select="$depth + 1"/>

Modified: xml/forrest/trunk/src/core/fresh-site/src/documentation/skinconf.xml
==============================================================================
--- xml/forrest/trunk/src/core/fresh-site/src/documentation/skinconf.xml	(original)
+++ xml/forrest/trunk/src/core/fresh-site/src/documentation/skinconf.xml	Sat Mar 20 07:52:39
2004
@@ -76,7 +76,8 @@
   <!ELEMENT width (#PCDATA)>
   <!ELEMENT height (#PCDATA)>
   <!ELEMENT toc EMPTY>
-  <!ATTLIST toc level CDATA #IMPLIED location CDATA #IMPLIED>
+  <!ATTLIST toc max-depth CDATA #IMPLIED min-sections CDATA #IMPLIED
+            location CDATA #IMPLIED>
   <!ELEMENT headings EMPTY>
   <!ATTLIST headings type CDATA #REQUIRED>
   <!ELEMENT colors (color*)>
@@ -171,14 +172,15 @@
   </trail>
 
   <!-- Configure the TOC, ie the Table of Contents.
-  @level
+  @max-depth
   how many "section" levels need to be included in the
-  generated Table of Contents (TOC). By default, if no toc element is provided
-  below, then 2 levels are included. Level 0 does not generate any TOC at all.
+  generated Table of Contents (TOC). 
+  @min-sections
+  Minimun requiered to create a TOC.
   @location ("page","menu","page,menu")
   Where to show the TOC.
   -->
-  <toc level="2" location="page"/>
+  <toc max-depth="2" min-sections="1" location="page"/>
 
   <!-- Heading types can be clean|underlined|boxed  -->
   <headings type="boxed"/>

Modified: xml/forrest/trunk/status.xml
==============================================================================
--- xml/forrest/trunk/status.xml	(original)
+++ xml/forrest/trunk/status.xml	Sat Mar 20 07:52:39 2004
@@ -45,6 +45,12 @@
   <changes>
     <release version="0.6-dev" date="unreleased">
       <action dev="JJP" type="add" context="core" >
+        Do not create TOC unless it has been define on the skinconf.
+        Change level attribute to max-depth attribute.
+        Add a min-sections attribute to define a minimun number of sections 
+        before create a toc.
+      </action>
+      <action dev="JJP" type="add" context="core" >
         Add Language alternativates div. To test it:
         i18n-foo.html
       </action>

Mime
View raw message