45fb8e8b1f659496e32f322dfc32097a70cf48a9
[exim-website.git] / templates / wrapper.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    <!-- Define display/content information -->
6       <xsl:output indent="yes"/>
7       <xsl:output encoding="UTF-8"/>
8       <xsl:output media-type="text/html"/>
9       <xsl:output omit-xml-declaration="yes"/>
10       <xsl:output doctype-public="XSLT-compat"/>
11
12    <!-- Define some variables -->
13       <xsl:variable name="docroot"/>
14       <xsl:variable name="html.head.title"/>
15       <xsl:variable name="html.head.description" select="'Exim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet.'"/>
16       <xsl:variable name="html.head.keywords" select="'exim,smtp,mta,email'"/>
17       <xsl:variable name="html.head.robots" select="'noodp,noydir,index,follow'"/>
18       <xsl:variable name="html.head.append"/>
19       <xsl:variable name="html.body.append"/>
20       <xsl:variable name="html.body.outer.append"/>
21
22    <!-- The main template code -->
23       <xsl:template match="/">
24          <html lang="en-GB">
25             <head>
26                <link rel="stylesheet" type="text/css" href="{$docroot}/common.css"/>
27
28                <meta name="author"      content="The Exim Project. &lt;http://www.exim.org/&gt;"/>
29                <meta name="copyright"   content="Copyright ©2010 The Exim Project. All rights reserved"/>
30                <meta name="description" content="{$html.head.description}"/>
31                <meta name="keywords"    content="{$html.head.keywords}"/>
32                <meta name="robots"      content="{$html.head.robots}"/>
33
34                <!-- Mobile Safari (iPhone) - Reduce viewport to physical size of device -->
35                   <meta name="viewport" content="width=device-width"/>
36
37                <title>
38                   <xsl:value-of select="$html.head.title"/>
39                </title>
40             
41                <xsl:copy-of select="$html.head.append"/>
42             </head>
43             <body>
44
45                 <!-- Header -->
46
47                    <h1 id="header">
48                       <a href="{$docroot}">Exim Internet Mailer</a>
49                    </h1>
50
51                 <!-- Outer Container -->
52
53                    <div id="outer">
54
55                       <!-- Navigation -->
56
57                          <ul id="nav_flow" class="nav">
58                             <li> <a href="{$docroot}/index.html">Home</a> </li>
59                             <li> <a href="{$docroot}/mirrors.html">Download</a> </li>
60                             <li> <a href="{$docroot}/docs.html">Documentation</a> </li>
61                             <li> <a href="{$docroot}/maillist.html">Mailing Lists</a> </li>
62                             <li> <a href="http://wiki.exim.org/">Wiki</a> </li>
63                             <li> <a href="http://www.exim.org/bugzilla/">Bugs</a> </li>
64                             <li> <a href="{$docroot}/credits.html">Credits</a> </li>
65
66                             <!-- Search Field -->
67
68                                <li class="search">
69                                   <form action="http://www.google.com/search" method="get">
70                                      <span class="search_field_container">
71                                         <input type="search" name="q" placeholder="Search Docs" class="search_field"/>
72                                      </span>
73                                      <input type="hidden" name="hl" value="en"/>
74                                      <input type="hidden" name="ie" value="UTF-8"/>
75                                      <input type="hidden" name="as_qdr" value="all"/>
76                                      <input type="hidden" name="q" value="site:www.exim.org"/>
77                                      <input type="hidden" name="q" value="inurl:exim-html-current"/>
78                                   </form>
79                                </li>
80                          </ul>
81
82                       <!-- MAIN CONTENT. This is the div that wraps around the other stylesheets -->
83                          <div id="inner">
84                             <div id="content">
85                               <xsl:call-template name="content"/>
86                            </div>
87                          </div>
88
89                       <!-- Branding -->
90                          <iframe id="branding" name="branding" src="{$docroot}/branding/branding.html" height="0" frameborder="no" scrolling="no"/>
91
92                       <!-- Footer -->
93
94                          <div id="footer">
95                             <xsl:text>Website design by </xsl:text>
96                             <a href="https://grepular.com/">Mike Cardwell</a>
97                             <xsl:text>, of </xsl:text>
98                             <a href="http://cardwellit.com/">Cardwell IT Ltd.</a>
99                          </div>
100
101                       <!-- Side Bars -->
102                          <div class="left_bar"/>
103                          <div class="right_bar"/>
104
105                       <!-- Append anything to the outer container? -->
106                          <xsl:copy-of select="$html.body.outer.append"/>
107                    </div>
108
109                 <!-- Load latest version of jQuery 1.4 from the Google CDN -->
110                    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
111
112                 <!-- Local JavaScript -->
113                    <script type="text/javascript" src="{$docroot}/common.js"></script>
114                    
115                    <xsl:copy-of select="$html.body.append"/>
116
117              </body>
118
119          </html>
120       </xsl:template>
121
122    <!-- Quote Element -->
123       <xsl:template match="quote">
124          <xsl:text>&#8220;</xsl:text><xsl:apply-templates match="*"/><xsl:text>&#8221;</xsl:text>
125       </xsl:template>
126
127    <!-- Random Docbook Elements -->
128       <xsl:template match="filename | emphasis | option | command | function">
129          <span class="docbook_{name()}"> <xsl:apply-templates/> </span>
130       </xsl:template>
131
132    <!-- Literal Element -->
133       <xsl:template match="literal">
134          <code class="docbook_literal"> <xsl:apply-templates/> </code>
135       </xsl:template>
136       <xsl:template match="literallayout">
137          <div class="docbook_literallayout"> <pre> <xsl:apply-templates/> </pre> </div>
138       </xsl:template>
139
140    <!-- ULink Element -->
141       <xsl:template match="ulink">
142          <a href="{text()}"> <xsl:value-of select="text()"/> </a>
143       </xsl:template>
144
145    <!-- XREF (Fixed up in the Perl) -->
146       <xsl:template match="xref">
147          <a href="{@url}" title="{@chapter_id}. {@chapter_title}">
148             <xsl:choose>
149                <xsl:when test="@section_id">
150                   <xsl:choose>
151                      <xsl:when test="@longref">
152                         <xsl:value-of select="@chapter_title"/>
153                         <small>
154                            <xsl:value-of select="concat(' [',@section_title,']')"/>
155                         </small>
156                      </xsl:when>
157                      <xsl:otherwise>
158                         <xsl:value-of select="concat(@chapter_id,'.',@section_id)"/>
159                      </xsl:otherwise>
160                   </xsl:choose>
161                </xsl:when>
162                <xsl:otherwise>
163                   <xsl:choose>
164                      <xsl:when test="@longref">
165                         <xsl:value-of select="@chapter_title"/>
166                      </xsl:when>
167                      <xsl:otherwise>
168                         <xsl:value-of select="@chapter_id"/>
169                      </xsl:otherwise>
170                   </xsl:choose>
171                </xsl:otherwise>
172             </xsl:choose>
173          </a>
174       </xsl:template>
175
176    <!-- Para -->
177       <xsl:template match="para">
178          <p>
179             <xsl:if test="@revisionflag!=''"><xsl:attribute name="class">changed</xsl:attribute></xsl:if>
180             <xsl:apply-templates/>
181          </p>
182       </xsl:template>
183
184    <!-- Lists -->
185       <xsl:template match="itemizedlist">                        <ul> <xsl:apply-templates/> </ul> </xsl:template>
186       <xsl:template match="itemizedlist/listitem">               <li> <xsl:apply-templates/> </li> </xsl:template>
187       <xsl:template match="orderedlist">                         <ol> <xsl:apply-templates/> </ol> </xsl:template>
188       <xsl:template match="orderedlist/listitem">                <li> <xsl:apply-templates/> </li> </xsl:template>
189       <xsl:template match="variablelist">                        <dl> <xsl:apply-templates/> </dl> </xsl:template>
190       <xsl:template match="variablelist/varlistentry/term">      <dt> <xsl:apply-templates/> </dt> </xsl:template>
191       <xsl:template match="variablelist/varlistentry/listitem">  <dd> <xsl:apply-templates/> </dd> </xsl:template>
192
193    <!-- Table -->
194       <xsl:template match="informaltable"> <table> <xsl:apply-templates/> </table> </xsl:template>
195       <xsl:template match="tbody/row">     <tr>    <xsl:apply-templates/> </tr>    </xsl:template>
196       <xsl:template match="row/entry">     <td>    <xsl:apply-templates/> </td>    </xsl:template>
197       <xsl:template match="tgroup|tbody"> <xsl:apply-templates/> </xsl:template>
198
199    <!-- Ignore -->
200       <xsl:template match="indexterm|title|titleabbrev|current_version"/>
201
202 </xsl:stylesheet>