1 <?xml version="1.0" encoding="utf-8"?>
3 Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
9 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12 <!-- Already included in the main style sheet -->
13 <!-- <xsl:import href="relative-href.xsl"/> -->
17 *none - only use explicitly set parameters
18 Boost - use standard boost settings, can be overridden
20 <xsl:param name = "boost.defaults" select = "'none'"/>
23 how to render the Home | Libraries | ... | More contents
24 *none - do not display ("standalone" mode)
25 horizontal - display in old-Boost style format (default for Boost)
26 vertical - like the new Getting Started layout
28 <xsl:param name = "nav.layout">
30 <xsl:when test = "$boost.defaults='Boost'">horizontal</xsl:when>
31 <xsl:otherwise>none</xsl:otherwise>
36 Boost - place the old-Boost border around the header
37 Fullbleed - Simple CSS based full bleed header image
38 *none - do not place a border around the header
40 <xsl:param name = "nav.border" select = "'none'" />
44 none - do not display navigation at the header
45 DocBook - display the navigation after the header
46 *Spirit - display "mini" navigation on the right
48 <xsl:param name = "nav.flow" select = "'Spirit'"/>
50 <!-- location of the various Boost elements -->
52 <xsl:param name = "boost.root" select = "'../..'"/>
53 <xsl:param name = "boost.website" select = "'http://www.boost.org'"/>
54 <!-- Logo image location, leave empty for no logo -->
55 <xsl:param name = "boost.image.src">
56 <xsl:if test = "$boost.defaults = 'Boost'">
57 <xsl:value-of select = "concat($boost.root, '/boost.png')"/>
60 <xsl:param name = "boost.image.alt">
61 <xsl:if test = "$boost.defaults = 'Boost'">
62 <xsl:value-of select = "'Boost C++ Libraries'"/>
65 <xsl:param name = "boost.image.w">
66 <xsl:if test = "$boost.defaults = 'Boost'">
67 <xsl:value-of select = "277"/>
70 <xsl:param name = "boost.image.h">
71 <xsl:if test = "$boost.defaults = 'Boost'">
72 <xsl:value-of select = "86"/>
75 <xsl:param name = "boost.libraries">
76 <xsl:if test = "$boost.defaults = 'Boost'">
77 <xsl:value-of select = "concat($boost.root, '/libs/libraries.htm')"/>
83 <xsl:template name = "header.navigation">
84 <xsl:param name = "prev" select = "/foo"/>
85 <xsl:param name = "next" select = "/foo"/>
86 <xsl:param name = "nav.context"/>
88 <xsl:variable name = "home" select = "/*[1]"/>
89 <xsl:variable name = "up" select = "parent::*"/>
92 <xsl:when test = "$nav.border = 'Fullbleed'">
93 <xsl:if test = "boolean(normalize-space($boost.image.src))">
94 <div class="header-fullbleed">
95 <img alt="{$boost.image.alt}" width="{$boost.image.w}" height="{$boost.image.h}">
96 <xsl:attribute name="src">
97 <xsl:call-template name="href.target.relative">
98 <xsl:with-param name="target" select="$boost.image.src"/>
105 <xsl:when test = "boolean(normalize-space($boost.image.src)) or $nav.layout != 'none'">
106 <table cellpadding = "2" width = "100%"><tr>
107 <xsl:if test = "$nav.border = 'Boost'">
108 <xsl:attribute name = "class">boost-head</xsl:attribute>
112 <xsl:if test = "$nav.border = 'Boost'">
113 <xsl:attribute name = "style">background-color: white; width: 50%;</xsl:attribute>
115 <xsl:if test = "boolean(normalize-space($boost.image.src))">
116 <img alt="{$boost.image.alt}" width="{$boost.image.w}" height="{$boost.image.h}">
117 <xsl:attribute name="src">
118 <xsl:call-template name="href.target.relative">
119 <xsl:with-param name="target" select="$boost.image.src"/>
125 <xsl:when test = "$nav.layout = 'horizontal'">
126 <xsl:call-template name = "header.navdata-horiz"/>
127 </xsl:when><xsl:when test = "$nav.layout = 'vertical'">
128 <xsl:call-template name = "header.navdata-vert"/>
136 <xsl:when test = "$nav.flow = 'DocBook'">
137 <table width = "100%" class = "navheader">
138 <xsl:call-template name = "navbar.docbook-homeinfo">
139 <xsl:with-param name = "prev" select = "$prev"/>
140 <xsl:with-param name = "next" select = "$next"/>
141 <xsl:with-param name = "nav.context" select = "$nav.context"/>
143 <xsl:call-template name = "navbar.docbook-prevnext">
144 <xsl:with-param name = "prev" select = "$prev"/>
145 <xsl:with-param name = "next" select = "$next"/>
146 <xsl:with-param name = "nav.context" select = "$nav.context"/>
149 </xsl:when><xsl:when test = "$nav.flow = 'Spirit'">
150 <xsl:call-template name = "navbar.spirit">
151 <xsl:with-param name = "prev" select = "$prev"/>
152 <xsl:with-param name = "next" select = "$next"/>
153 <xsl:with-param name = "nav.context" select = "$nav.context"/>
159 <xsl:template name = "header.navdata-horiz">
160 <xsl:variable name="home_link">
161 <xsl:call-template name="href.target.relative">
162 <xsl:with-param name="target" select="concat( $boost.root, '/index.html' )"/>
165 <xsl:variable name="libraries_link">
166 <xsl:if test = "boolean($boost.libraries)">
167 <xsl:call-template name="href.target.relative">
168 <xsl:with-param name="target" select="$boost.libraries"/>
172 <xsl:variable name="people_link">
173 <xsl:call-template name="href.target.relative">
174 <xsl:with-param name="target" select="concat( $boost.website, '/users/people.html' )"/>
177 <xsl:variable name="faq_link">
178 <xsl:call-template name="href.target.relative">
179 <xsl:with-param name="target" select="concat( $boost.website, '/users/faq.html' )"/>
182 <xsl:variable name="more_link">
183 <xsl:call-template name="href.target.relative">
184 <xsl:with-param name="target" select="concat( $boost.root, '/more/index.htm' )"/>
189 <xsl:when test = "$nav.border = 'Boost'">
190 <td align = "center" class = "boost-headtd"><a href = "{$home_link}" class = "boost-headelem">Home</a></td>
191 <xsl:if test = "boolean($libraries_link)">
192 <td align = "center" class = "boost-headtd"><a href = "{$libraries_link}" class = "boost-headelem">Libraries</a></td>
194 <td align = "center" class = "boost-headtd"><a href = "{$people_link}" class = "boost-headelem">People</a></td>
195 <td align = "center" class = "boost-headtd"><a href = "{$faq_link}" class = "boost-headelem">FAQ</a></td>
196 <td align = "center" class = "boost-headtd"><a href = "{$more_link}" class = "boost-headelem">More</a></td>
197 </xsl:when><xsl:otherwise>
198 <td align = "center"><a href = "{$home_link}">Home</a></td>
199 <td align = "center"><a href = "{$libraries_link}">Libraries</a></td>
200 <td align = "center"><a href = "{$people_link}">People</a></td>
201 <td align = "center"><a href = "{$faq_link}">FAQ</a></td>
202 <td align = "center"><a href = "{$more_link}">More</a></td>
207 <xsl:template name = "header.navdata-vert">
208 <xsl:variable name="home_link">
209 <xsl:call-template name="href.target.relative">
210 <xsl:with-param name="target" select="concat( $boost.root, '/index.html' )"/>
213 <xsl:variable name="libraries_link">
214 <xsl:call-template name="href.target.relative">
215 <xsl:with-param name="target" select="$boost.libraries"/>
218 <xsl:variable name="people_link">
219 <xsl:call-template name="href.target.relative">
220 <xsl:with-param name="target" select="concat( $boost.website, '/users/people.html' )"/>
223 <xsl:variable name="faq_link">
224 <xsl:call-template name="href.target.relative">
225 <xsl:with-param name="target" select="concat( $boost.website, '/users/faq.html' )"/>
228 <xsl:variable name="more_link">
229 <xsl:call-template name="href.target.relative">
230 <xsl:with-param name="target" select="concat( $boost.root, '/more/index.htm' )"/>
235 <xsl:if test = "$nav.border != 'Boost'">
236 <xsl:attribute name = "class">boost-toc</xsl:attribute>
238 <div><a href = "{$home_link}">Home</a></div>
239 <div><a href = "{$libraries_link}">Libraries</a></div>
240 <div><a href = "{$people_link}">People</a></div>
241 <div><a href = "{$faq_link}">FAQ</a></div>
242 <div><a href = "{$more_link}">More</a></div>
249 <xsl:template name = "footer.navigation">
250 <xsl:param name = "prev" select = "/foo"/>
251 <xsl:param name = "next" select = "/foo"/>
252 <xsl:param name = "nav.context"/>
256 <xsl:when test = "$nav.flow = 'DocBook'">
257 <table width = "100%" class = "navheader">
258 <xsl:call-template name = "navbar.docbook-prevnext">
259 <xsl:with-param name = "prev" select = "$prev"/>
260 <xsl:with-param name = "next" select = "$next"/>
261 <xsl:with-param name = "nav.context" select = "$nav.context"/>
263 <xsl:call-template name = "navbar.docbook-homeinfo">
264 <xsl:with-param name = "prev" select = "$prev"/>
265 <xsl:with-param name = "next" select = "$next"/>
266 <xsl:with-param name = "nav.context" select = "$nav.context"/>
269 </xsl:when><xsl:when test = "$nav.flow = 'Spirit'">
270 <xsl:call-template name = "navbar.spirit">
271 <xsl:with-param name = "prev" select = "$prev"/>
272 <xsl:with-param name = "next" select = "$next"/>
273 <xsl:with-param name = "nav.context" select = "$nav.context"/>
281 <xsl:template name = "navbar.docbook-homeinfo">
282 <xsl:param name = "prev" select = "/foo"/>
283 <xsl:param name = "next" select = "/foo"/>
284 <xsl:param name = "nav.context"/>
286 <xsl:variable name = "home" select = "/*[1]"/>
288 <td align = "left" width = "40%">
289 <xsl:if test = "$navig.showtitles != 0"> <!-- prev:name -->
290 <xsl:apply-templates select = "$prev" mode = "object.title.markup"/>
292 </td><td align = "center" width = "20%">
294 <xsl:if test = "$home != . or $nav.context = 'toc'">
296 <xsl:attribute name = "href"><xsl:call-template name = "href.target">
297 <xsl:with-param name = "object" select = "$home"/>
298 </xsl:call-template></xsl:attribute>
299 <xsl:call-template name = "navig.content">
300 <xsl:with-param name = "direction" select = "'home'"/>
303 <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
304 <xsl:text>|</xsl:text>
307 <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"><a accesskey = "t">
308 <xsl:attribute name = "href">
309 <xsl:apply-templates select = "/*[1]" mode = "recursive-chunk-filename"/>
310 <xsl:text>-toc</xsl:text>
311 <xsl:value-of select = "$html.ext"/>
313 <xsl:call-template name = "gentext">
314 <xsl:with-param name = "key" select = "'nav-toc'"/>
317 </td><td align = "right" width = "40%">
318 <xsl:if test = "$navig.showtitles != 0"> <!-- next:name -->
319 <xsl:apply-templates select = "$next" mode = "object.title.markup"/>
325 <xsl:template name = "navbar.docbook-prevnext">
326 <xsl:param name = "prev" select = "/foo"/>
327 <xsl:param name = "next" select = "/foo"/>
328 <xsl:param name = "nav.context"/>
330 <xsl:variable name = "up" select = "parent::*"/>
332 <td align = "left" width = "40%">
333 <xsl:if test = "count($prev)>0"><a accesskey = "p"> <!-- prev -->
334 <xsl:attribute name = "href"><xsl:call-template name = "href.target">
335 <xsl:with-param name = "object" select = "$prev"/>
336 </xsl:call-template></xsl:attribute>
337 <xsl:call-template name = "navig.content">
338 <xsl:with-param name = "direction" select = "'prev'"/>
341 </td><td align = "center" width = "20%">
342 <xsl:if test = "count($up)>0"><a accesskey = "u"> <!-- up -->
343 <xsl:attribute name = "href"><xsl:call-template name = "href.target">
344 <xsl:with-param name = "object" select = "$up"/>
345 </xsl:call-template></xsl:attribute>
346 <xsl:call-template name = "navig.content">
347 <xsl:with-param name = "direction" select = "'up'"/>
350 </td><td align = "right" width = "40%">
351 <xsl:if test = "count($next)>0"><a accesskey = "n"> <!-- next -->
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'"/>
363 <xsl:template name = "navbar.spirit">
364 <xsl:param name = "prev" select = "/foo"/>
365 <xsl:param name = "next" select = "/foo"/>
366 <xsl:param name = "nav.context"/>
368 <xsl:variable name = "home" select = "/*[1]"/>
369 <xsl:variable name = "up" select = "parent::*"/>
371 <div class = "spirit-nav">
373 <xsl:if test = "count($prev)>0"><a accesskey = "p">
374 <xsl:attribute name = "href"><xsl:call-template name = "href.target">
375 <xsl:with-param name = "object" select = "$prev"/>
376 </xsl:call-template></xsl:attribute>
377 <xsl:call-template name = "navig.content">
378 <xsl:with-param name = "direction" select = "'prev'"/>
382 <xsl:if test = "count($up)>0"><a accesskey = "u">
383 <xsl:attribute name = "href"><xsl:call-template name = "href.target">
384 <xsl:with-param name = "object" select = "$up"/>
385 </xsl:call-template></xsl:attribute>
386 <xsl:call-template name = "navig.content">
387 <xsl:with-param name = "direction" select = "'up'"/>
391 <xsl:if test = "generate-id($home) != generate-id(.) or $nav.context = 'toc'">
393 <xsl:attribute name = "href"><xsl:call-template name = "href.target">
394 <xsl:with-param name = "object" select = "$home"/>
395 </xsl:call-template></xsl:attribute>
396 <xsl:call-template name = "navig.content">
397 <xsl:with-param name = "direction" select = "'home'"/>
400 <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
401 <xsl:text>|</xsl:text>
404 <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"><a accesskey = "t">
405 <xsl:attribute name = "href">
406 <xsl:apply-templates select = "/*[1]" mode = "recursive-chunk-filename"/>
407 <xsl:text>-toc</xsl:text>
408 <xsl:value-of select = "$html.ext"/>
410 <xsl:call-template name = "gentext">
411 <xsl:with-param name = "key" select = "'nav-toc'"/>
415 <xsl:if test = "count($next)>0"><a accesskey = "n">
416 <xsl:attribute name = "href"><xsl:call-template name = "href.target">
417 <xsl:with-param name = "object" select = "$next"/>
418 </xsl:call-template></xsl:attribute>
419 <xsl:call-template name = "navig.content">
420 <xsl:with-param name = "direction" select = "'next'"/>