Merge branch 'master' of github.com:nigelm/exim-website
[exim-website.git] / templates / doc / chapter.xsl
index 13a7c91e73ec7279be142752c97363fbfa574422..6fd6d8c99702c49d60c1ccc2d4c12acb7d5f3bd0 100644 (file)
       <xsl:template match="/chapter">
 
          <!-- Navigation -->
       <xsl:template match="/chapter">
 
          <!-- Navigation -->
-           <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
-           <a class="next_page"     href="{next_url}"><![CDATA[next->]]></a>
+         <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
+        <xsl:if test="next_url">
+            <a class="next_page" href="{next_url}"><![CDATA[next->]]></a>
+         </xsl:if>
 
 
-         <!-- Chapter Title -->
-            <h2>
+         <!-- Chapter Wrapper -->
+         <div id="chapter" class="chapter{@class}">
+
+            <!-- Chapter Title -->
+            <h2 id="{@id}" class="{@class}">
                <xsl:value-of select="concat('Chapter ',chapter_id,' - ',title)"/>
             </h2>
 
                <xsl:value-of select="concat('Chapter ',chapter_id,' - ',title)"/>
             </h2>
 
-         <!-- Chapter Info -->
-            <div id="chapter">
+            <!-- Chapter Info -->
                <xsl:apply-templates select="*[name()!='section']"/>
                <xsl:apply-templates select="section"/>
                <xsl:apply-templates select="*[name()!='section']"/>
                <xsl:apply-templates select="section"/>
-            </div>
+         </div>
 
          <!-- Navigation -->
             <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
 
          <!-- Navigation -->
             <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
 
    <!-- Section -->
       <xsl:template match="/chapter/section">
 
    <!-- Section -->
       <xsl:template match="/chapter/section">
-
-         <!-- Section Title -->
-            <h3 id="{@id}">
-               <xsl:value-of select="concat(position(),'. ',title)"/>
-            </h3>
-
-         <!-- Section Paragraphs -->
+         <!-- Section Wrapper -->
+         <div class="section{@class}">
+
+            <!-- Section Title -->
+            <xsl:choose>
+               <xsl:when test="@class='index'">
+                  <h3 id="{@id}" class="{@class}">
+                     <xsl:value-of select="title"/>
+                  </h3>
+               </xsl:when>
+               <xsl:otherwise>
+                  <h3 id="{@id}" class="{@class}">
+                     <xsl:value-of select="concat(position(),'. ',title)"/>
+                  </h3>
+               </xsl:otherwise>
+            </xsl:choose>
+
+            <!-- Section Paragraphs -->
             <xsl:apply-templates select="*"/>
             <xsl:apply-templates select="*"/>
+         </div>
       </xsl:template>
 
    <!-- Section paragraph -->
       </xsl:template>
 
    <!-- Section paragraph -->