Imported initial website redesign work
[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    <!-- CONTENT -->
32       <xsl:template match="/chapter">
33
34          <!-- Navigation -->
35            <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
36            <a class="next_page"     href="{next_url}"><![CDATA[next->]]></a>
37
38          <!-- Chapter Title -->
39             <h2>
40                <xsl:value-of select="concat('Chapter ',chapter_id,' - ',title)"/>
41             </h2>
42
43          <!-- Chapter Info -->
44             <div id="chapter">
45                <xsl:apply-templates select="*[name()!='section']"/>
46                <xsl:apply-templates select="section"/>
47             </div>
48
49          <!-- Navigation -->
50             <a class="previous_page" href="{prev_url}"><![CDATA[<-previous]]></a>
51             <a class="next_page"     href="{next_url}"><![CDATA[next->]]></a>
52
53       </xsl:template>
54
55    <!-- Section -->
56       <xsl:template match="/chapter/section">
57
58          <!-- Section Title -->
59             <h3 id="{@id}">
60                <xsl:value-of select="concat(position(),'. ',title)"/>
61             </h3>
62
63          <!-- Section Paragraphs -->
64             <xsl:apply-templates select="*"/>
65       </xsl:template>
66
67    <!-- Section paragraph -->
68       <xsl:template match="/chapter/section/para">
69          <p>
70             <xsl:if test="@revisionflag!=''"><xsl:attribute name="class">changed</xsl:attribute></xsl:if>
71             <xsl:apply-templates/>
72          </p>
73       </xsl:template>
74
75    <!-- Ignore -->
76       <xsl:template match="chapter_id|prev_url|next_url|canonical_url"/>
77
78 </xsl:stylesheet>