Add table of contents to documentation pages
[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 ©2010The 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                <title>
35                   <xsl:value-of select="$html.head.title"/>
36                </title>
37             
38                <xsl:copy-of select="$html.head.append"/>
39             </head>
40             <body>
41
42                 <!-- Header -->
43
44                    <h1 id="header">
45                       <a href="{$docroot}">Exim Internet Mailer</a>
46                    </h1>
47
48                 <!-- Outer Container -->
49
50                    <div id="outer">
51
52                       <!-- Navigation -->
53
54                          <ul class="navigation">
55                             <li> <a href="{$docroot}/mirrors.html">Download</a> </li>
56                             <li> <a href="{$docroot}/docs.html">Documentation</a> </li>
57                             <li> <a href="{$docroot}/maillist.html">Mailing Lists</a> </li>
58                             <li> <a href="http://wiki.exim.org/">Wiki</a> </li>
59                             <li> <a href="http://www.exim.org/bugzilla/">Bugs</a> </li>
60                             <li> <a href="{$docroot}/credits.html">Credits</a> </li>
61
62                             <!-- Search Field -->
63
64                                <li class="search">
65                                   <form action="http://www.google.com/search" method="get">
66                                      <span class="search_field_container">
67                                         <input type="search" name="q" placeholder="Search Docs" class="search_field"/>
68                                      </span>
69                                      <input type="hidden" name="hl" value="en"/>
70                                      <input type="hidden" name="ie" value="UTF-8"/>
71                                      <input type="hidden" name="as_qdr" value="all"/>
72                                      <input type="hidden" name="q" value="site:www.exim.org"/>
73                                      <input type="hidden" name="q" value="inurl:exim-html-current"/>
74                                   </form>
75                                </li>
76                          </ul>
77
78                       <!-- MAIN CONTENT. This is the div that wraps around the other stylesheets -->
79                          <div id="inner">
80                             <xsl:call-template name="content"/>
81                          </div>
82
83                       <!-- Branding -->
84                          <iframe id="branding" name="branding" src="{$docroot}/branding/branding.html" height="0" frameborder="no" scrolling="no"/>
85
86                       <!-- Footer -->
87
88                          <div id="footer">
89                             <xsl:text>Website design by </xsl:text>
90                             <a href="https://secure.grepular.com/">Mike Cardwell</a>
91                             <xsl:text>, of </xsl:text>
92                             <a href="http://cardwellit.com/">Cardwell IT Ltd.</a>
93                          </div>
94
95                       <!-- Side Bars -->
96                          <div class="left_bar"/>
97                          <div class="right_bar"/>
98
99                       <!-- Append anything to the outer container? -->
100                          <xsl:copy-of select="$html.body.outer.append"/>
101                    </div>
102
103                 <!-- Load latest version of jQuery 1.4 from the Google CDN -->
104                    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
105
106                 <!-- Local JavaScript -->
107                    <script type="text/javascript" src="{$docroot}/common.js"></script>
108                    
109                    <xsl:copy-of select="$html.body.append"/>
110
111              </body>
112
113          </html>
114       </xsl:template>
115
116    <!-- Quote Element -->
117       <xsl:template match="quote">
118          <xsl:text>&#8220;</xsl:text><xsl:apply-templates match="*"/><xsl:text>&#8221;</xsl:text>
119       </xsl:template>
120
121    <!-- Random Docbook Elements -->
122       <xsl:template match="filename | emphasis | option | command | function">
123          <span class="docbook_{name()}"> <xsl:apply-templates/> </span>
124       </xsl:template>
125
126    <!-- Literal Element -->
127       <xsl:template match="literal">
128          <code class="docbook_literal"> <xsl:apply-templates/> </code>
129       </xsl:template>
130       <xsl:template match="literallayout">
131          <div class="docbook_literallayout"> <pre> <xsl:apply-templates/> </pre> </div>
132       </xsl:template>
133
134    <!-- ULink Element -->
135       <xsl:template match="ulink">
136          <a href="{text()}"> <xsl:value-of select="text()"/> </a>
137       </xsl:template>
138
139    <!-- XREF (Fixed up in the Perl) -->
140       <xsl:template match="xref">
141          <a href="{@url}" title="{@chapter_id}. {@chapter_title}">
142             <xsl:choose>
143                <xsl:when test="@section_id">
144                   <xsl:value-of select="concat(@chapter_id,'.',@section_id)"/>
145                </xsl:when>
146                <xsl:otherwise>
147                   <xsl:value-of select="@chapter_id"/>
148                </xsl:otherwise>
149             </xsl:choose>
150          </a>
151       </xsl:template>
152
153    <!-- Para -->
154       <xsl:template match="para"> <p> <xsl:apply-templates/> </p> </xsl:template>
155
156    <!-- Lists -->
157       <xsl:template match="itemizedlist">          <ul> <xsl:apply-templates/> </ul> </xsl:template>
158       <xsl:template match="itemizedlist/listitem"> <li> <xsl:apply-templates/> </li> </xsl:template>
159       <xsl:template match="orderedlist">           <ol> <xsl:apply-templates/> </ol> </xsl:template>
160       <xsl:template match="orderedlist/listitem">  <li> <xsl:apply-templates/> </li> </xsl:template>
161
162    <!-- Table -->
163       <xsl:template match="informaltable"> <table> <xsl:apply-templates/> </table> </xsl:template>
164       <xsl:template match="tbody/row">     <tr>    <xsl:apply-templates/> </tr>    </xsl:template>
165       <xsl:template match="row/entry">     <td>    <xsl:apply-templates/> </td>    </xsl:template>
166       <xsl:template match="tgroup|tbody"> <xsl:apply-templates/> </xsl:template>
167
168    <!-- Ignore -->
169       <xsl:template match="indexterm|title|titleabbrev|current_version"/>
170
171 </xsl:stylesheet>