[library-web] [xslt] added possibility for an introduction paragraph in subsections



commit aa26e111178cbb1e7c3b6eeb23b8b0a8518e1f3e
Author: Frédéric Péters <fpeters 0d be>
Date:   Sun Nov 1 13:44:45 2009 +0100

    [xslt] added possibility for an introduction paragraph in subsections

 data/xslt/indexes.xsl |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/data/xslt/indexes.xsl b/data/xslt/indexes.xsl
index 155255e..9c59d67 100644
--- a/data/xslt/indexes.xsl
+++ b/data/xslt/indexes.xsl
@@ -148,6 +148,21 @@ along with libgo; if not, write to the Free Software Foundation, Inc.,
     </xsl:choose>
   </xsl:template>
 
+  <xsl:template match="subsection" mode="intro">
+    <xsl:param name="lang"/>
+    <xsl:if test="intro">
+      <p>
+      <xsl:choose>
+        <xsl:when test="intro[ xml:lang = $lang]">
+          <xsl:value-of select="intro[ xml:lang = $lang]"/>
+        </xsl:when>
+        <xsl:otherwise><xsl:value-of select="intro"/></xsl:otherwise>
+      </xsl:choose>
+      </p>
+    </xsl:if>
+  </xsl:template>
+
+
 
   <xsl:template name="overlay-section-title">
     <xsl:param name="lang"/>
@@ -437,13 +452,17 @@ along with libgo; if not, write to the Free Software Foundation, Inc.,
 
     <xsl:for-each select="section">
       <xsl:sort select="format-number(@weight, '0.000')" order="descending"/>
+      <xsl:variable name="title" select="@title"/>
       <h3 class="subsection" id="{ title}">
-        <xsl:variable name="title" select="@title"/>
         <xsl:apply-templates select="document('../overlay.xml')//subsection[ id = $title]"
                              mode="title">
           <xsl:with-param name="lang" select="$lang" />
         </xsl:apply-templates>
       </h3>
+      <xsl:apply-templates select="document('../overlay.xml')//subsection[ id = $title]"
+                           mode="intro">
+        <xsl:with-param name="lang" select="$lang" />
+      </xsl:apply-templates>
       <dl class="doc-index">
       <xsl:for-each select="document">
         <xsl:sort select="format-number(@weight, '0.000')" order="descending"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]