1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
3 | version="1.0"> |
---|
4 | |
---|
5 | <xsl:import href="relative-href.xsl"/> |
---|
6 | |
---|
7 | <!-- |
---|
8 | how to render the Home | Libraries | ... | More contents |
---|
9 | none - do not display ("standalone" mode) |
---|
10 | *horizontal - display in old-Boost style format |
---|
11 | vertical - like the new Getting Started layout |
---|
12 | --> |
---|
13 | <xsl:param name = "nav.layout" select = "'horizontal'"/> |
---|
14 | |
---|
15 | <!-- |
---|
16 | header border layout |
---|
17 | Boost - place the old-Boost border around the header |
---|
18 | *none - do not place a border around the header |
---|
19 | --> |
---|
20 | <xsl:param name = "nav.border" select = "'none'" /> |
---|
21 | |
---|
22 | <!-- |
---|
23 | nav.flow: |
---|
24 | none - do not display navigation at the header |
---|
25 | DocBook - display the navigation after the header |
---|
26 | *Spirit - display "mini" navigation on the right |
---|
27 | --> |
---|
28 | <xsl:param name = "nav.flow" select = "'Spirit'"/> |
---|
29 | |
---|
30 | <!-- location of the various Boost elements --> |
---|
31 | |
---|
32 | <xsl:param name = "boost.root" select = "'../..'"/> |
---|
33 | <xsl:param name = "boost.image.src" |
---|
34 | select = "concat($boost.root, '/boost.png')"/> |
---|
35 | <xsl:param name = "boost.image.alt" select = "'boost.png (6897 bytes)'"/> |
---|
36 | <xsl:param name = "boost.image.w" select = "277"/> |
---|
37 | <xsl:param name = "boost.image.h" select = "86"/> |
---|
38 | <xsl:param name = "boost.libraries" select = "'libraries.html'"/> |
---|
39 | |
---|
40 | <!-- header --> |
---|
41 | |
---|
42 | <xsl:template name = "header.navigation"> |
---|
43 | <xsl:param name = "prev" select = "/foo"/> |
---|
44 | <xsl:param name = "next" select = "/foo"/> |
---|
45 | <xsl:param name = "nav.context"/> |
---|
46 | |
---|
47 | <xsl:variable name = "home" select = "/*[1]"/> |
---|
48 | <xsl:variable name = "up" select = "parent::*"/> |
---|
49 | |
---|
50 | <table cellpadding = "2" width = "100%"> |
---|
51 | <xsl:if test = "$nav.border = 'Boost'"> |
---|
52 | <xsl:attribute name = "class">boost-head</xsl:attribute> |
---|
53 | </xsl:if> |
---|
54 | |
---|
55 | <td valign = "top"> |
---|
56 | <xsl:if test = "$nav.border = 'Boost'"> |
---|
57 | <xsl:attribute name = "style">background-color: white; width: 50%;</xsl:attribute> |
---|
58 | </xsl:if> |
---|
59 | <img alt="{$boost.image.alt}" width="{$boost.image.w}" height="{$boost.image.h}"> |
---|
60 | <xsl:attribute name="src"> |
---|
61 | <xsl:call-template name="href.target.relative"> |
---|
62 | <xsl:with-param name="target" select="$boost.image.src"/> |
---|
63 | </xsl:call-template> |
---|
64 | </xsl:attribute> |
---|
65 | </img> |
---|
66 | </td><xsl:choose> |
---|
67 | <xsl:when test = "$nav.layout = 'horizontal'"> |
---|
68 | <xsl:call-template name = "header.navdata-horiz"/> |
---|
69 | </xsl:when><xsl:when test = "$nav.layout = 'vertical'"> |
---|
70 | <xsl:call-template name = "header.navdata-vert"/> |
---|
71 | </xsl:when> |
---|
72 | </xsl:choose> |
---|
73 | </table> |
---|
74 | <hr/> |
---|
75 | <xsl:choose> |
---|
76 | <xsl:when test = "$nav.flow = 'DocBook'"> |
---|
77 | <table width = "100%" class = "navheader"> |
---|
78 | <xsl:call-template name = "navbar.docbook-homeinfo"> |
---|
79 | <xsl:with-param name = "prev" select = "$prev"/> |
---|
80 | <xsl:with-param name = "next" select = "$next"/> |
---|
81 | <xsl:with-param name = "nav.context" select = "$nav.context"/> |
---|
82 | </xsl:call-template> |
---|
83 | <xsl:call-template name = "navbar.docbook-prevnext"> |
---|
84 | <xsl:with-param name = "prev" select = "$prev"/> |
---|
85 | <xsl:with-param name = "next" select = "$next"/> |
---|
86 | <xsl:with-param name = "nav.context" select = "$nav.context"/> |
---|
87 | </xsl:call-template> |
---|
88 | </table> |
---|
89 | </xsl:when><xsl:when test = "$nav.flow = 'Spirit'"> |
---|
90 | <xsl:call-template name = "navbar.spirit"> |
---|
91 | <xsl:with-param name = "prev" select = "$prev"/> |
---|
92 | <xsl:with-param name = "next" select = "$next"/> |
---|
93 | <xsl:with-param name = "nav.context" select = "$nav.context"/> |
---|
94 | </xsl:call-template> |
---|
95 | </xsl:when> |
---|
96 | </xsl:choose> |
---|
97 | </xsl:template> |
---|
98 | |
---|
99 | <xsl:template name = "header.navdata-horiz"> |
---|
100 | <xsl:variable name="home_link"> |
---|
101 | <xsl:call-template name="href.target.relative"> |
---|
102 | <xsl:with-param name="target" select="concat( $boost.root, '/index.htm' )"/> |
---|
103 | </xsl:call-template> |
---|
104 | </xsl:variable> |
---|
105 | <xsl:variable name="libraries_link"> |
---|
106 | <xsl:call-template name="href.target.relative"> |
---|
107 | <xsl:with-param name="target" select="$boost.libraries"/> |
---|
108 | </xsl:call-template> |
---|
109 | </xsl:variable> |
---|
110 | <xsl:variable name="people_link"> |
---|
111 | <xsl:call-template name="href.target.relative"> |
---|
112 | <xsl:with-param name="target" select="concat( $boost.root, '/people/people.htm' )"/> |
---|
113 | </xsl:call-template> |
---|
114 | </xsl:variable> |
---|
115 | <xsl:variable name="faq_link"> |
---|
116 | <xsl:call-template name="href.target.relative"> |
---|
117 | <xsl:with-param name="target" select="concat( $boost.root, '/more/faq.htm' )"/> |
---|
118 | </xsl:call-template> |
---|
119 | </xsl:variable> |
---|
120 | <xsl:variable name="more_link"> |
---|
121 | <xsl:call-template name="href.target.relative"> |
---|
122 | <xsl:with-param name="target" select="concat( $boost.root, '/more/index.htm' )"/> |
---|
123 | </xsl:call-template> |
---|
124 | </xsl:variable> |
---|
125 | |
---|
126 | <xsl:choose> |
---|
127 | <xsl:when test = "$nav.border = 'Boost'"> |
---|
128 | <td align = "center" class = "boost-headtd"><a href = "{$home_link}" class = "boost-headelem">Home</a></td> |
---|
129 | <td align = "center" class = "boost-headtd"><a href = "{$libraries_link}" class = "boost-headelem">Libraries</a></td> |
---|
130 | <td align = "center" class = "boost-headtd"><a href = "{$people_link}" class = "boost-headelem">People</a></td> |
---|
131 | <td align = "center" class = "boost-headtd"><a href = "{$faq_link}" class = "boost-headelem">FAQ</a></td> |
---|
132 | <td align = "center" class = "boost-headtd"><a href = "{$more_link}" class = "boost-headelem">More</a></td> |
---|
133 | </xsl:when><xsl:otherwise> |
---|
134 | <td align = "center"><a href = "{$home_link}">Home</a></td> |
---|
135 | <td align = "center"><a href = "{$libraries_link}">Libraries</a></td> |
---|
136 | <td align = "center"><a href = "{$people_link}">People</a></td> |
---|
137 | <td align = "center"><a href = "{$faq_link}">FAQ</a></td> |
---|
138 | <td align = "center"><a href = "{$more_link}">More</a></td> |
---|
139 | </xsl:otherwise> |
---|
140 | </xsl:choose> |
---|
141 | </xsl:template> |
---|
142 | |
---|
143 | <xsl:template name = "header.navdata-vert"> |
---|
144 | <xsl:variable name="home_link"> |
---|
145 | <xsl:call-template name="href.target.relative"> |
---|
146 | <xsl:with-param name="target" select="concat( $boost.root, '/index.htm' )"/> |
---|
147 | </xsl:call-template> |
---|
148 | </xsl:variable> |
---|
149 | <xsl:variable name="libraries_link"> |
---|
150 | <xsl:call-template name="href.target.relative"> |
---|
151 | <xsl:with-param name="target" select="$boost.libraries"/> |
---|
152 | </xsl:call-template> |
---|
153 | </xsl:variable> |
---|
154 | <xsl:variable name="people_link"> |
---|
155 | <xsl:call-template name="href.target.relative"> |
---|
156 | <xsl:with-param name="target" select="concat( $boost.root, '/people/people.htm' )"/> |
---|
157 | </xsl:call-template> |
---|
158 | </xsl:variable> |
---|
159 | <xsl:variable name="faq_link"> |
---|
160 | <xsl:call-template name="href.target.relative"> |
---|
161 | <xsl:with-param name="target" select="concat( $boost.root, '/more/faq.htm' )"/> |
---|
162 | </xsl:call-template> |
---|
163 | </xsl:variable> |
---|
164 | <xsl:variable name="more_link"> |
---|
165 | <xsl:call-template name="href.target.relative"> |
---|
166 | <xsl:with-param name="target" select="concat( $boost.root, '/more/index.htm' )"/> |
---|
167 | </xsl:call-template> |
---|
168 | </xsl:variable> |
---|
169 | |
---|
170 | <td><div> |
---|
171 | <xsl:if test = "$nav.border != 'Boost'"> |
---|
172 | <xsl:attribute name = "class">boost-toc</xsl:attribute> |
---|
173 | </xsl:if> |
---|
174 | <div><a href = "{$home_link}">Home</a></div> |
---|
175 | <div><a href = "{$libraries_link}">Libraries</a></div> |
---|
176 | <div><a href = "{$people_link}">People</a></div> |
---|
177 | <div><a href = "{$faq_link}">FAQ</a></div> |
---|
178 | <div><a href = "{$more_link}">More</a></div> |
---|
179 | </div></td> |
---|
180 | </xsl:template> |
---|
181 | |
---|
182 | |
---|
183 | <!-- footer --> |
---|
184 | |
---|
185 | <xsl:template name = "footer.navigation"> |
---|
186 | <xsl:param name = "prev" select = "/foo"/> |
---|
187 | <xsl:param name = "next" select = "/foo"/> |
---|
188 | <xsl:param name = "nav.context"/> |
---|
189 | |
---|
190 | <hr/> |
---|
191 | <xsl:choose> |
---|
192 | <xsl:when test = "$nav.flow = 'DocBook'"> |
---|
193 | <table width = "100%" class = "navheader"> |
---|
194 | <xsl:call-template name = "navbar.docbook-prevnext"> |
---|
195 | <xsl:with-param name = "prev" select = "$prev"/> |
---|
196 | <xsl:with-param name = "next" select = "$next"/> |
---|
197 | <xsl:with-param name = "nav.context" select = "$nav.context"/> |
---|
198 | </xsl:call-template> |
---|
199 | <xsl:call-template name = "navbar.docbook-homeinfo"> |
---|
200 | <xsl:with-param name = "prev" select = "$prev"/> |
---|
201 | <xsl:with-param name = "next" select = "$next"/> |
---|
202 | <xsl:with-param name = "nav.context" select = "$nav.context"/> |
---|
203 | </xsl:call-template> |
---|
204 | </table> |
---|
205 | </xsl:when><xsl:when test = "$nav.flow = 'Spirit'"> |
---|
206 | <xsl:call-template name = "navbar.spirit"> |
---|
207 | <xsl:with-param name = "prev" select = "$prev"/> |
---|
208 | <xsl:with-param name = "next" select = "$next"/> |
---|
209 | <xsl:with-param name = "nav.context" select = "$nav.context"/> |
---|
210 | </xsl:call-template> |
---|
211 | </xsl:when> |
---|
212 | </xsl:choose> |
---|
213 | </xsl:template> |
---|
214 | |
---|
215 | <!-- navbar --> |
---|
216 | |
---|
217 | <xsl:template name = "navbar.docbook-homeinfo"> |
---|
218 | <xsl:param name = "prev" select = "/foo"/> |
---|
219 | <xsl:param name = "next" select = "/foo"/> |
---|
220 | <xsl:param name = "nav.context"/> |
---|
221 | |
---|
222 | <xsl:variable name = "home" select = "/*[1]"/> |
---|
223 | <tr> |
---|
224 | <td align = "left" width = "40%"> |
---|
225 | <xsl:if test = "$navig.showtitles != 0"> <!-- prev:name --> |
---|
226 | <xsl:apply-templates select = "$prev" mode = "object.title.markup"/> |
---|
227 | </xsl:if> |
---|
228 | </td><td align = "center" width = "20%"> |
---|
229 | <!-- home --> |
---|
230 | <xsl:if test = "$home != . or $nav.context = 'toc'"> |
---|
231 | <a accesskey = "h"> |
---|
232 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
233 | <xsl:with-param name = "object" select = "$home"/> |
---|
234 | </xsl:call-template></xsl:attribute> |
---|
235 | <xsl:call-template name = "navig.content"> |
---|
236 | <xsl:with-param name = "direction" select = "'home'"/> |
---|
237 | </xsl:call-template> |
---|
238 | </a> |
---|
239 | <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> |
---|
240 | <xsl:text>|</xsl:text> |
---|
241 | </xsl:if> |
---|
242 | </xsl:if> |
---|
243 | <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"><a accesskey = "t"> |
---|
244 | <xsl:attribute name = "href"> |
---|
245 | <xsl:apply-templates select = "/*[1]" mode = "recursive-chunk-filename"/> |
---|
246 | <xsl:text>-toc</xsl:text> |
---|
247 | <xsl:value-of select = "$html.ext"/> |
---|
248 | </xsl:attribute> |
---|
249 | <xsl:call-template name = "gentext"> |
---|
250 | <xsl:with-param name = "key" select = "'nav-toc'"/> |
---|
251 | </xsl:call-template> |
---|
252 | </a></xsl:if> |
---|
253 | </td><td align = "right" width = "40%"> |
---|
254 | <xsl:if test = "$navig.showtitles != 0"> <!-- next:name --> |
---|
255 | <xsl:apply-templates select = "$next" mode = "object.title.markup"/> |
---|
256 | </xsl:if> |
---|
257 | </td> |
---|
258 | </tr> |
---|
259 | </xsl:template> |
---|
260 | |
---|
261 | <xsl:template name = "navbar.docbook-prevnext"> |
---|
262 | <xsl:param name = "prev" select = "/foo"/> |
---|
263 | <xsl:param name = "next" select = "/foo"/> |
---|
264 | <xsl:param name = "nav.context"/> |
---|
265 | |
---|
266 | <xsl:variable name = "up" select = "parent::*"/> |
---|
267 | <tr> |
---|
268 | <td align = "left" width = "40%"> |
---|
269 | <xsl:if test = "count($prev)>0"><a accesskey = "p"> <!-- prev --> |
---|
270 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
271 | <xsl:with-param name = "object" select = "$prev"/> |
---|
272 | </xsl:call-template></xsl:attribute> |
---|
273 | <xsl:call-template name = "navig.content"> |
---|
274 | <xsl:with-param name = "direction" select = "'prev'"/> |
---|
275 | </xsl:call-template> |
---|
276 | </a></xsl:if> |
---|
277 | </td><td align = "center" width = "20%"> |
---|
278 | <xsl:if test = "count($up)>0"><a accesskey = "u"> <!-- up --> |
---|
279 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
280 | <xsl:with-param name = "object" select = "$up"/> |
---|
281 | </xsl:call-template></xsl:attribute> |
---|
282 | <xsl:call-template name = "navig.content"> |
---|
283 | <xsl:with-param name = "direction" select = "'up'"/> |
---|
284 | </xsl:call-template> |
---|
285 | </a></xsl:if> |
---|
286 | </td><td align = "right" width = "40%"> |
---|
287 | <xsl:if test = "count($next)>0"><a accesskey = "n"> <!-- next --> |
---|
288 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
289 | <xsl:with-param name = "object" select = "$next"/> |
---|
290 | </xsl:call-template></xsl:attribute> |
---|
291 | <xsl:call-template name = "navig.content"> |
---|
292 | <xsl:with-param name = "direction" select = "'next'"/> |
---|
293 | </xsl:call-template> |
---|
294 | </a></xsl:if> |
---|
295 | </td> |
---|
296 | </tr> |
---|
297 | </xsl:template> |
---|
298 | |
---|
299 | <xsl:template name = "navbar.spirit"> |
---|
300 | <xsl:param name = "prev" select = "/foo"/> |
---|
301 | <xsl:param name = "next" select = "/foo"/> |
---|
302 | <xsl:param name = "nav.context"/> |
---|
303 | |
---|
304 | <xsl:variable name = "home" select = "/*[1]"/> |
---|
305 | <xsl:variable name = "up" select = "parent::*"/> |
---|
306 | |
---|
307 | <div class = "spirit-nav"> |
---|
308 | <!-- prev --> |
---|
309 | <xsl:if test = "count($prev)>0"><a accesskey = "p"> |
---|
310 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
311 | <xsl:with-param name = "object" select = "$prev"/> |
---|
312 | </xsl:call-template></xsl:attribute> |
---|
313 | <xsl:call-template name = "navig.content"> |
---|
314 | <xsl:with-param name = "direction" select = "'prev'"/> |
---|
315 | </xsl:call-template> |
---|
316 | </a></xsl:if> |
---|
317 | <!-- up --> |
---|
318 | <xsl:if test = "count($up)>0"><a accesskey = "u"> |
---|
319 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
320 | <xsl:with-param name = "object" select = "$up"/> |
---|
321 | </xsl:call-template></xsl:attribute> |
---|
322 | <xsl:call-template name = "navig.content"> |
---|
323 | <xsl:with-param name = "direction" select = "'up'"/> |
---|
324 | </xsl:call-template> |
---|
325 | </a></xsl:if> |
---|
326 | <!-- home --> |
---|
327 | <xsl:if test = "$home != . or $nav.context = 'toc'"> |
---|
328 | <a accesskey = "h"> |
---|
329 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
330 | <xsl:with-param name = "object" select = "$home"/> |
---|
331 | </xsl:call-template></xsl:attribute> |
---|
332 | <xsl:call-template name = "navig.content"> |
---|
333 | <xsl:with-param name = "direction" select = "'home'"/> |
---|
334 | </xsl:call-template> |
---|
335 | </a> |
---|
336 | <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"> |
---|
337 | <xsl:text>|</xsl:text> |
---|
338 | </xsl:if> |
---|
339 | </xsl:if> |
---|
340 | <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"><a accesskey = "t"> |
---|
341 | <xsl:attribute name = "href"> |
---|
342 | <xsl:apply-templates select = "/*[1]" mode = "recursive-chunk-filename"/> |
---|
343 | <xsl:text>-toc</xsl:text> |
---|
344 | <xsl:value-of select = "$html.ext"/> |
---|
345 | </xsl:attribute> |
---|
346 | <xsl:call-template name = "gentext"> |
---|
347 | <xsl:with-param name = "key" select = "'nav-toc'"/> |
---|
348 | </xsl:call-template> |
---|
349 | </a></xsl:if> |
---|
350 | <!-- next --> |
---|
351 | <xsl:if test = "count($next)>0"><a accesskey = "n"> |
---|
352 | <xsl:attribute name = "href"><xsl:call-template name = "href.target"> |
---|
353 | <xsl:with-param name = "object" select = "$next"/> |
---|
354 | </xsl:call-template></xsl:attribute> |
---|
355 | <xsl:call-template name = "navig.content"> |
---|
356 | <xsl:with-param name = "direction" select = "'next'"/> |
---|
357 | </xsl:call-template> |
---|
358 | </a></xsl:if> |
---|
359 | </div> |
---|
360 | </xsl:template> |
---|
361 | </xsl:stylesheet> |
---|