2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
5 <!-- textdecoration-1 applies the style to the text to highlight an region
6 of the documentation refers to a lustre specific version.
8 the overall purpose of this custom style is to add
9 decoration to the rendered version of the manual to show lustre version
10 specific features. This is used in the manual docbook markup by
11 adding a condition='lNM' element to a node. When rendered,
12 the node contents is decorated to indicate it is only available in
13 the N.M version of lustre. -->
15 <!-- textdecoration-1: a template to apply a div with a class
16 around the relevant sections of text. -->
17 <xsl:template name='textdecoration-1'>
18 <xsl:param name='version'/>
19 <xsl:param name='content'/>
20 <div class='versionbox'>
21 <span class='versionlabel'>
22 <xsl:value-of select='$version'/>
24 <span class='versioncontent'>
25 <xsl:copy-of select="$content"/>
30 <!-- conditional matching template: this calls text decoration
31 template with the correct variables. -->
32 <xsl:template name="condition-decorator">
33 <xsl:param name='content'/>
35 <xsl:when test="@condition = 'l21'">
36 <xsl:call-template name='textdecoration-1'>
37 <xsl:with-param name='version' select="'Introduced in Lustre 2.1'"/>
38 <xsl:with-param name='content' select="$content"/>
41 <xsl:when test="@condition = 'l22'">
42 <xsl:call-template name='textdecoration-1'>
43 <xsl:with-param name='version' select="'Introduced in Lustre 2.2'"/>
44 <xsl:with-param name='content' select="$content"/>
47 <xsl:when test="@condition = 'l23'">
48 <xsl:call-template name='textdecoration-1'>
49 <xsl:with-param name='version' select="'Introduced in Lustre 2.3'"/>
50 <xsl:with-param name='content' select="$content"/>
53 <xsl:when test="@condition = 'l24'">
54 <xsl:call-template name='textdecoration-1'>
55 <xsl:with-param name='version' select="'Introduced in Lustre 2.4'"/>
56 <xsl:with-param name='content' select="$content"/>
59 <xsl:when test="@condition = 'l25'">
60 <xsl:call-template name='textdecoration-1'>
61 <xsl:with-param name='version' select="'Introduced in Lustre 2.5'"/>
62 <xsl:with-param name='content' select="$content"/>
65 <xsl:when test="@condition = 'l26'">
66 <xsl:call-template name='textdecoration-1'>
67 <xsl:with-param name='version' select="'Introduced in Lustre 2.6'"/>
68 <xsl:with-param name='content' select="$content"/>
71 <xsl:when test="@condition = 'l27'">
72 <xsl:call-template name='textdecoration-1'>
73 <xsl:with-param name='version' select="'Introduced in Lustre 2.7'"/>
74 <xsl:with-param name='content' select="$content"/>
77 <xsl:when test="@condition = 'l28'">
78 <xsl:call-template name='textdecoration-1'>
79 <xsl:with-param name='version' select="'Introduced in Lustre 2.8'"/>
80 <xsl:with-param name='content' select="$content"/>
83 <xsl:when test="@condition = 'l29'">
84 <xsl:call-template name='textdecoration-1'>
85 <xsl:with-param name='version' select="'Introduced in Lustre 2.9'"/>
86 <xsl:with-param name='content' select="$content"/>
89 <xsl:when test="@condition != ''">
90 <xsl:call-template name='textdecoration-1'>
91 <xsl:with-param name='version' select="'Introduced in Lustre 2.9'"/>
92 <xsl:with-param name='content' select="$content"/>
96 <xsl:copy-of select="$content"/>
101 <!-- toc.line template: This template over loads the behavior of creating the table of contents. It
102 adds in a small entry to identify lustre version specific features.
103 for more information, see this page:
104 http://xml.web.cern.ch/XML/www.sagehill.net/xml/docbookxsl/PrintCustomEx.html#PrintTocEntries -->
105 <xsl:template name="toc.line">
106 <xsl:param name="toc-context" select="."/>
107 <xsl:param name="depth" select="1"/>
108 <xsl:param name="depth.from.context" select="8"/>
111 <xsl:attribute name="class">
112 <xsl:value-of select="local-name(.)"/>
115 <!-- * if $autotoc.label.in.hyperlink is zero, then output the label -->
116 <!-- * before the hyperlinked title (as the DSSSL stylesheet does) -->
117 <xsl:if test="$autotoc.label.in.hyperlink = 0">
118 <xsl:variable name="label">
119 <xsl:apply-templates select="." mode="label.markup"/>
121 <xsl:copy-of select="$label"/>
122 <xsl:if test="$label != ''">
123 <xsl:value-of select="$autotoc.label.separator"/>
128 <xsl:attribute name="href">
129 <xsl:call-template name="href.target">
130 <xsl:with-param name="context" select="$toc-context"/>
131 <xsl:with-param name="toc-context" select="$toc-context"/>
135 <!-- * if $autotoc.label.in.hyperlink is non-zero, then output the label
136 as part of the hyperlinked title -->
137 <xsl:if test="not($autotoc.label.in.hyperlink = 0)">
138 <xsl:variable name="label">
139 <xsl:apply-templates select="." mode="label.markup"/>
141 <xsl:copy-of select="$label"/>
142 <xsl:if test="$label != ''">
143 <xsl:value-of select="$autotoc.label.separator"/>
146 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
149 <xsl:call-template name="condition-title">
150 <xsl:with-param name="condition" select="@condition"/>
154 <xsl:template name="condition-title">
155 <xsl:param name='condition'/>
156 <!-- add another span to hold the lustre version annotation -->
158 <xsl:when test="$condition = 'l21'">
159 <span class='floatright'>L 2.1 </span>
161 <xsl:when test="$condition = 'l22'">
162 <span class='floatright'>L 2.2 </span>
164 <xsl:when test="$condition = 'l23'">
165 <span class='floatright'>L 2.3 </span>
167 <xsl:when test="$condition = 'l24'">
168 <span class='floatright'>L 2.4 </span>
170 <xsl:when test="$condition = 'l25'">
171 <span class='floatright'>L 2.5 </span>
173 <xsl:when test="$condition = 'l26'">
174 <span class='floatright'>L 2.6 </span>
176 <xsl:when test="$condition = 'l27'">
177 <span class='floatright'>L 2.7 </span>
179 <xsl:when test="$condition = 'l28'">
180 <span class='floatright'>L 2.8 </span>
182 <xsl:when test="$condition = 'l29'">
183 <span class='floatright'>L 2.9 </span>
185 <xsl:when test="$condition != ''">
186 <span class='floatright'>L ?.? </span>