]> git.stg.codes - stg.git/blob - doc/xslt/slides/html/default.xsl
[NY] Code deduplication.
[stg.git] / doc / xslt / slides / html / default.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 version="1.0">
4
5 <xsl:import href="slides-common.xsl"/>
6
7 <xsl:output method="html"/>
8
9 <xsl:param name="css.stylesheet" select="'slides-default.css'"/>
10
11 <xsl:template name="top-nav">
12   <xsl:param name="home"/>
13   <xsl:param name="up"/>
14   <xsl:param name="next"/>
15   <xsl:param name="prev"/>
16   <xsl:param name="tocfile" select="$toc.html"/>
17
18   <div class="navhead">
19     <table width="100%" border="0" cellpadding="0" cellspacing="0"
20            summary="Navigation">
21       <tr>
22         <xsl:call-template name="generate.toc.hide.show"/>
23         <td align="left" width="10%">
24           <xsl:choose>
25             <xsl:when test="$prev">
26               <a>
27                 <xsl:attribute name="href">
28                   <xsl:apply-templates select="$prev" mode="filename"/>
29                 </xsl:attribute>
30
31                 <img alt="Prev" border="0">
32                   <xsl:attribute name="src">
33                     <xsl:call-template name="prev.image"/>
34                   </xsl:attribute>
35                 </img>
36               </a>
37             </xsl:when>
38             <xsl:otherwise>&#160;</xsl:otherwise>
39           </xsl:choose>
40         </td>
41         <td align="center" width="80%">
42           <xsl:variable name="prestitle">
43             <xsl:value-of select="(/slides/slidesinfo/title
44                                   |/slides/title)[1]"/>
45           </xsl:variable>
46
47           <span class="navheader">
48             <xsl:value-of select="$prestitle"/>
49           </span>
50         </td>
51         <td align="right" width="10%">
52           <xsl:choose>
53             <xsl:when test="$next">
54               <a>
55                 <xsl:attribute name="href">
56                   <xsl:apply-templates select="$next" mode="filename"/>
57                 </xsl:attribute>
58
59                 <img alt="Next" border="0">
60                   <xsl:attribute name="src">
61                     <xsl:call-template name="next.image"/>
62                   </xsl:attribute>
63                 </img>
64               </a>
65             </xsl:when>
66             <xsl:otherwise>&#160;</xsl:otherwise>
67           </xsl:choose>
68         </td>
69       </tr>
70     </table>
71     <hr class="top-nav-sep"/>
72   </div>
73 </xsl:template>
74
75 <xsl:template name="bottom-nav">
76   <xsl:param name="home"/>
77   <xsl:param name="up"/>
78   <xsl:param name="next"/>
79   <xsl:param name="prev"/>
80   <xsl:param name="tocfile" select="$toc.html"/>
81
82   <div class="navfoot">
83     <hr class="bottom-nav-sep"/>
84     <table width="100%" border="0" cellpadding="0" cellspacing="0"
85            summary="Navigation">
86       <tr>
87         <td align="left" width="80%" valign="top">
88           <span class="navfooter">
89             <xsl:apply-templates select="/slides/slidesinfo/copyright"
90                                  mode="slide.footer.mode"/>
91           </span>
92         </td>
93         <td align="right" width="20%" valign="top">
94           <span class="index">
95             <xsl:value-of select="count(preceding::foil)
96                                   + count(preceding::foilgroup)
97                                   + count(ancestor::foilgroup)
98                                   + 1"/>
99           </span>
100           <xsl:text>&#160;</xsl:text>
101         </td>
102       </tr>
103     </table>
104   </div>
105 </xsl:template>
106
107 <!-- ====================================================================== -->
108
109 <xsl:template name="titlepage-top-nav">
110   <xsl:param name="home"/>
111   <xsl:param name="up"/>
112   <xsl:param name="next"/>
113   <xsl:param name="prev"/>
114   <xsl:param name="tocfile" select="$toc.html"/>
115
116   <div class="navhead">
117     <table width="100%" border="0" cellpadding="0" cellspacing="0"
118            summary="Navigation">
119       <tr>
120         <td align="left" width="10%">
121           <span class="toclink">
122             <a href="{$toc.html}">
123               <xsl:call-template name="gentext">
124                 <xsl:with-param name="key">TableofContents</xsl:with-param>
125               </xsl:call-template>
126             </a>
127           </span>
128         </td>
129         <td align="center" width="80%">
130           <xsl:text>&#160;</xsl:text>
131         </td>
132         <td align="right" width="10%">
133           <xsl:text>&#160;</xsl:text>
134         </td>
135       </tr>
136     </table>
137   </div>
138 </xsl:template>
139
140 <xsl:template name="titlepage-bottom-nav">
141   <xsl:param name="home"/>
142   <xsl:param name="up"/>
143   <xsl:param name="next"/>
144   <xsl:param name="prev"/>
145   <xsl:param name="tocfile" select="$toc.html"/>
146
147   <div class="navfoot">
148     <table width="100%" border="0"
149            cellspacing="0" cellpadding="0"
150            summary="Navigation">
151       <tr>
152         <td align="left" width="80%" valign="top">
153           <span class="navfooter">
154             <xsl:apply-templates select="/slides/slidesinfo/copyright"
155                                  mode="slide.footer.mode"/>
156           </span>
157         </td>
158         <td align="right" width="20%" valign="top">
159           <a>
160             <xsl:attribute name="href">
161               <xsl:apply-templates select="(following::foilgroup|following::foil)[1]"
162                                    mode="filename"/>
163             </xsl:attribute>
164             <img alt="Next" border="0">
165               <xsl:attribute name="src">
166                 <xsl:call-template name="next.image"/>
167               </xsl:attribute>
168             </img>
169           </a>
170         </td>
171       </tr>
172     </table>
173   </div>
174 </xsl:template>
175
176 <xsl:template name="toc-top-nav">
177   <xsl:param name="home"/>
178   <xsl:param name="up"/>
179   <xsl:param name="next"/>
180   <xsl:param name="prev"/>
181   <xsl:param name="tocfile" select="$toc.html"/>
182
183   <div class="navhead">
184     <table width="100%" border="0" cellpadding="0" cellspacing="0"
185            summary="Navigation">
186       <tr>
187         <td align="left">
188           <xsl:text>&#160;</xsl:text>
189         </td>
190       </tr>
191     </table>
192   </div>
193 </xsl:template>
194
195 <xsl:template name="toc-bottom-nav">
196   <div class="navfoot">
197     <table width="100%" border="0"
198            cellspacing="0" cellpadding="0"
199            summary="Navigation">
200       <tr>
201         <td align="left" width="80%" valign="top">
202           <span class="navfooter">
203             <xsl:apply-templates select="/slides/slidesinfo/copyright"
204                                  mode="slide.footer.mode"/>
205           </span>
206         </td>
207         <td align="right" width="20%" valign="top">
208           <a href="{$titlefoil.html}">
209             <img alt="Next" border="0">
210               <xsl:attribute name="src">
211                 <xsl:call-template name="next.image"/>
212               </xsl:attribute>
213             </img>
214           </a>
215         </td>
216       </tr>
217     </table>
218   </div>
219 </xsl:template>
220
221 <!-- ====================================================================== -->
222
223 <xsl:template name="generate.toc.hide.show">
224   <xsl:if test="$toc.hide.show != 0">
225     <td>
226       <img hspace="4" alt="Hide/Show TOC">
227         <xsl:attribute name="src">
228           <xsl:call-template name="hidetoc.image"/>
229         </xsl:attribute>
230         <xsl:attribute name="onClick">
231           <xsl:text>toggletoc(this,</xsl:text>
232           <xsl:value-of select="$toc.width"/>
233           <xsl:text>,'</xsl:text>
234           <xsl:call-template name="hidetoc.image"/>
235           <xsl:text>','</xsl:text>
236           <xsl:call-template name="showtoc.image"/>
237           <xsl:text>');</xsl:text>
238         </xsl:attribute>
239       </img>
240     </td>
241   </xsl:if>
242 </xsl:template>
243
244 <!-- ====================================================================== -->
245
246 <xsl:template match="@*" mode="copy">
247   <xsl:attribute name="{local-name(.)}">
248     <xsl:value-of select="."/>
249   </xsl:attribute>
250 </xsl:template>
251
252 <xsl:template match="html:*" xmlns:html='http://www.w3.org/1999/xhtml'>
253   <xsl:element name="{local-name(.)}" namespace="">
254     <xsl:apply-templates select="@*" mode="copy"/>
255     <xsl:apply-templates/>
256   </xsl:element>
257 </xsl:template>
258
259 <!-- ====================================================================== -->
260
261 </xsl:stylesheet>