13a7c91e73ec7279be142752c97363fbfa574422
[exim-website.git] / templates / doc / chapter.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4    
5    <!-- WRAPPER -->
6       <xsl:import href="../wrapper.xsl"/>
7       <xsl:template match="/"> <xsl:apply-imports/> </xsl:template>
8       <xsl:template name="content"><xsl:apply-templates/></xsl:template>
9       
10    <!-- Where am I relative to the root. Lets mirrors host this in subfolders -->
11       <xsl:variable name="docroot" select="'../../../..'"/>
12
13    <!-- Title -->
14       <xsl:variable name="html.head.title" select="concat(/chapter/chapter_id,'. ',/chapter/title)"/>
15
16    <xsl:variable name="html.head.append">
17
18       <!-- CSS -->
19          <link rel="stylesheet" type="text/css" href="{$docroot}/doc/chapter.css"/>
20
21       <!-- Canonical -->
22          <link rel="canonical" href="{/chapter/canonical_url}"/>
23
24    </xsl:variable>
25  
26    <!-- JavaScript -->
27       <xsl:variable name="html.body.append">
28          <script type="text/javascript" src="{$docroot}/doc/chapter.js"/>
29       </xsl:variable>
30
31    <!-- Table of Contents -->
32       <xsl:variable name="html.body.outer.append">
33          <div id="toc">
34             <ul class="hidden"/>
35             <img src="../../../../doc/contents.png" width="16" height="155"/>
36          </div>
37       </xsl:variable>
38
39    <!-- CONTENT -->
40       <xsl:template match="/chapter">
41
42          <!-- Navigation -->
43            <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
44            <a class="next_page"     href="{next_url}"><![CDATA[next->]]></a>
45
46          <!-- Chapter Title -->
47             <h2>
48                <xsl:value-of select="concat('Chapter ',chapter_id,' - ',title)"/>
49             </h2>
50
51          <!-- Chapter Info -->
52             <div id="chapter">
53                <xsl:apply-templates select="*[name()!='section']"/>
54                <xsl:apply-templates select="section"/>
55             </div>
56
57          <!-- Navigation -->
58             <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
59             <a class="next_page"     href="{next_url}"><![CDATA[next->]]></a>
60
61       </xsl:template>
62
63    <!-- Section -->
64       <xsl:template match="/chapter/section">
65
66          <!-- Section Title -->
67             <h3 id="{@id}">
68                <xsl:value-of select="concat(position(),'. ',title)"/>
69             </h3>
70
71          <!-- Section Paragraphs -->
72             <xsl:apply-templates select="*"/>
73       </xsl:template>
74
75    <!-- Section paragraph -->
76       <xsl:template match="/chapter/section/para">
77          <p>
78             <xsl:if test="@revisionflag!=''"><xsl:attribute name="class">changed</xsl:attribute></xsl:if>
79             <xsl:apply-templates/>
80          </p>
81       </xsl:template>
82
83    <!-- Ignore -->
84       <xsl:template match="chapter_id|prev_url|next_url|canonical_url"/>
85
86 </xsl:stylesheet>