forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: rev 36261 - in forrest/trunk/src/core/context/skins/pelt-dev: css xslt/html
Date Wed, 11 Aug 2004 23:28:17 GMT
Author: thorsten
Date: Wed Aug 11 16:28:16 2004
New Revision: 36261

Modified:
   forrest/trunk/src/core/context/skins/pelt-dev/css/screen.css
   forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/document2html.xsl
   forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/site2xhtml.xsl
Log:
added the toc in page location


Modified: forrest/trunk/src/core/context/skins/pelt-dev/css/screen.css
==============================================================================
--- forrest/trunk/src/core/context/skins/pelt-dev/css/screen.css	(original)
+++ forrest/trunk/src/core/context/skins/pelt-dev/css/screen.css	Wed Aug 11 16:28:16 2004
@@ -325,6 +325,19 @@
 
 acronym { cursor: help; }
 
+#minitoc-area {
+	border-top: solid 1px #4C6C8F;
+	border-bottom: solid 1px #4C6C8F;	
+	margin-bottom: 15px;
+	margin-left: 15px;
+	padding-bottom: 5px;
+	padding-top: 5px;
+}
+#minitoc    { 
+	list-style-image: url('images/current.gif'); 
+	font-weight: normal;
+	font-size: 80%;
+}
 li p {
 	margin: 0;
 	padding: 0;

Modified: forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/document2html.xsl
==============================================================================
--- forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/document2html.xsl	(original)
+++ forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/document2html.xsl	Wed Aug 11 16:28:16
2004
@@ -54,14 +54,65 @@
       
     </div>
   </xsl:template>
+  <xsl:template match="body">
+    <div id="skinconf-toc-page"/>
+    <xsl:apply-templates/>
+  </xsl:template>
+  
   
+  <xsl:template match="@id">
+    <xsl:apply-imports/>
+  </xsl:template>
+
   <xsl:template match="section">
+    <a name="{generate-id()}"/>
+    <xsl:apply-templates select="@id"/>
+
+    <xsl:variable name = "level" select = "count(ancestor::section)+1" />
+
+    <xsl:choose>
+      <xsl:when test="$level=1">
+        <div class="skinconf-heading-{$level}">
+          <h1><xsl:value-of select="title"/></h1>
+        </div>
+        <div class="section"><xsl:apply-templates/></div>  
+      </xsl:when>
+      <xsl:when test="$level=2">
+        <div class="skinconf-heading-{$level}">
+          <h1><xsl:value-of select="title"/></h1>
+        </div>
+        <xsl:apply-templates select="*[not(self::title)]"/>
+      </xsl:when>
+      <!-- If a faq, answer sections will be level 3 (1=Q/A, 2=part) -->
+      <xsl:when test="$level=3 and $notoc='true'">
+        <h4 class="faq"><xsl:value-of select="title"/></h4>
+        <div align="right"><a href="#{@id}-menu">^</a></div>
+        <div style="margin-left: 15px">
+          <xsl:apply-templates select="*[not(self::title)]"/>
+        </div>
+      </xsl:when>
+      <xsl:when test="$level=3">
+        <h4><xsl:value-of select="title"/></h4>
+        <xsl:apply-templates select="*[not(self::title)]"/>
+
+      </xsl:when>
+
+      <xsl:otherwise>
+        <h5><xsl:value-of select="title"/></h5>
+        <xsl:apply-templates select="*[not(self::title)]"/>
+      </xsl:otherwise>
+    </xsl:choose>
+
+  </xsl:template>  
+  
+  
+  <!--xsl:template match="section"-->
     <!-- count the number of section in the ancestor-or-self axis to compute
-         the title element name later on -->
+         the title element name later on -
     <xsl:variable name="sectiondepth" select="count(ancestor-or-self::section)"/>
     <a name="{generate-id()}"/>
-    <xsl:apply-templates select="@id"/>
-    <!-- generate a title element, level 1 -> h2, level 2 -> h3 and so on... -->
+    <xsl:apply-templates select="@id"/-->
+    <!-- generate a title element, level 1 -> h2, level 2 -> h3 and so on... -
     <xsl:element name="{concat('h',$sectiondepth + 1)}">
       <xsl:value-of select="title"/>
       <xsl:if test="$notoc='true' and $sectiondepth = 3">
@@ -70,7 +121,7 @@
     </xsl:element>
 
     <xsl:apply-templates select="*[not(self::title)]"/>
-  </xsl:template>
+  </xsl:template-->
   
   <!-- Generates the "printer friendly version" link -->
   <!--xsl:template name="printlink">

Modified: forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/site2xhtml.xsl
==============================================================================
--- forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/site2xhtml.xsl	(original)
+++ forrest/trunk/src/core/context/skins/pelt-dev/xslt/html/site2xhtml.xsl	Wed Aug 11 16:28:16
2004
@@ -465,6 +465,43 @@
       </div>
     </xsl:if>
   </xsl:template>
+<xsl:template match="div[@id='skinconf-toc-page']">
+    <xsl:if test="$config/toc">
+      <xsl:if test="contains($minitoc-location,'page')">
+        <xsl:if test="count(//tocitems/tocitem) >= $config/toc/@min-sections">
+          <xsl:call-template name="minitoc">
+            <xsl:with-param name="tocroot" select="//tocitems"/>
+          </xsl:call-template>
+        </xsl:if>
+      </xsl:if>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="minitoc">  
+    <xsl:param name="tocroot"/>
+    
+    
+    <xsl:if test="count($tocroot/tocitem) >= $config/toc/@min-sections">
+    <xsl:if test="contains($config/toc/@location,'page')"> 
+	<div id="minitoc-area">
+      <ul id="minitoc">
+        <xsl:for-each select="$tocroot/tocitem">
+          <li>
+            <a href="{@href}">
+              <xsl:value-of select="@title"/>
+            </a>
+            <xsl:if test="@level&lt;//skinconfig/toc/@max-depth+1">
+              <xsl:call-template name="minitoc">
+                <xsl:with-param name="tocroot" select="."/>
+              </xsl:call-template>
+            </xsl:if>
+          </li>
+        </xsl:for-each>
+      </ul>
+	</div>
+    </xsl:if>
+    </xsl:if>
+  </xsl:template>
   <xsl:template match="node()|@*" priority="-1">
     <xsl:copy>
       <xsl:apply-templates select="@*"/>

Mime
View raw message