2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4 xmlns:d="http://docbook.org/ns/docbook"
5 exclude-result-prefixes="d"
7 <!-- xsl:import takes place at compile time. For this reason, I sed in the correct
8 primary xsl pdf, and then run xsltproc -->
9 <xsl:import href="PRIMARYXSL"/>
10 <xsl:output method='xml'/>
12 <xsl:param name="fop1.extensions" select="1"></xsl:param>
13 <xsl:param name="chapter.autolabel" select="1"></xsl:param>
14 <xsl:param name="section.autolabel" select="1"></xsl:param>
15 <xsl:param name="appendix.autolabel" select="1"></xsl:param>
16 <xsl:param name="autotoc.label.in.hyperlink" select="1"></xsl:param>
17 <xsl:param name="section.label.includes.component.label" select="1"></xsl:param>
19 <!-- textdecoration_1 applies the style to the text to highlight an region
20 of the documentation refers to a lustre specific version.
22 template_{1,2,3} all use the 'condition="{l23,l24}" attributes and add
23 decoration to the rendered version of the manual to show lustre version
24 specific features. -->
26 <!-- textdecoration_1: a template to highlight regions of text. -->
27 <xsl:template name='textdecoration_1'>
28 <xsl:param name='version'/>
29 <xsl:param name='chunkid'/>
30 <fo:block-container id="{$chunkid}"
35 <fo:block-container float='left' text-indent='3px' start-indent='-20px'>
36 <fo:block background-color="gray">
37 <xsl:value-of select='$version'/>
40 <fo:block text-indent='0px' start-indent='0px'>
41 <xsl:apply-templates/>
46 <!-- conditional matching template: this calls text decoration
47 template with the correct variables. -->
48 <xsl:template match="*[@condition]">
49 <xsl:variable name="id">
50 <xsl:call-template name="object.id"/>
52 <xsl:call-template name='section.titlepage'/>
54 <xsl:when test="@condition = 'l21'">
55 <xsl:call-template name='textdecoration_1'>
56 <xsl:with-param name='version' select="'introduced in Lustre 2.1'"/>
57 <xsl:with-param name='chunkid' select="$id"/>
60 <xsl:when test="@condition = 'l22'">
61 <xsl:call-template name='textdecoration_1'>
62 <xsl:with-param name='version' select="'introduced in Lustre 2.2'"/>
63 <xsl:with-param name='chunkid' select="$id"/>
66 <xsl:when test="@condition = 'l23'">
67 <xsl:call-template name='textdecoration_1'>
68 <xsl:with-param name='version' select="'introduced in Lustre 2.3'"/>
69 <xsl:with-param name='chunkid' select="$id"/>
72 <xsl:when test="@condition = 'l24'">
73 <xsl:call-template name='textdecoration_1'>
74 <xsl:with-param name='version' select="'introduced in Lustre 2.4'"/>
75 <xsl:with-param name='chunkid' select="$id"/>
78 <xsl:when test="@condition = 'l25'">
79 <xsl:call-template name='textdecoration_1'>
80 <xsl:with-param name='version' select="'introduced in Lustre 2.5'"/>
81 <xsl:with-param name='chunkid' select="$id"/>
85 <xsl:call-template name='textdecoration_1'>
86 <xsl:with-param name='version' select="'unrecognised Lustre version'"/>
87 <xsl:with-param name='chunkid' select="$id"/>
93 <!-- toc.line template: This template over loads the behavior of creating the table of contents. It
94 adds in a small entry to identify lustre version specific features.
95 for more information, see this page:
96 http://xml.web.cern.ch/XML/www.sagehill.net/xml/docbookxsl/PrintCustomEx.html#PrintTocEntries -->
97 <xsl:template name="toc.line">
98 <xsl:variable name="id">
99 <xsl:call-template name="object.id"/>
101 <xsl:variable name="lustrecond">
103 <xsl:when test="@condition='l21'">L 2.1</xsl:when>
104 <xsl:when test="@condition='l22'">L 2.2</xsl:when>
105 <xsl:when test="@condition='l23'">L 2.3</xsl:when>
106 <xsl:when test="@condition='l24'">L 2.4</xsl:when>
107 <xsl:when test="@condition='l25'">L 2.5</xsl:when>
108 <xsl:otherwise></xsl:otherwise>
112 <xsl:variable name="label">
113 <xsl:apply-templates select="." mode="label.markup"/>
115 <fo:block text-align-last="justify"
116 end-indent="{$toc.indent.width}pt"
117 last-line-end-indent="-{$toc.indent.width}pt">
118 <fo:inline keep-with-next.within-line="always">
120 <xsl:when test="local-name(.) = 'chapter'">
121 <xsl:attribute name="font-weight">bold</xsl:attribute>
124 <fo:basic-link internal-destination="{$id}">
125 <xsl:if test="$label != ''">
126 <xsl:copy-of select="$label"/>
127 <xsl:value-of select="$autotoc.label.separator"/>
129 <xsl:apply-templates select="." mode="title.markup"/>
132 <fo:inline keep-together.within-line="always">
133 <xsl:text> </xsl:text>
134 <fo:leader leader-pattern="dots"
135 leader-pattern-width="3pt"
136 leader-alignment="reference-area"
137 keep-with-next.within-line="always"/>
138 <xsl:text> </xsl:text>
139 <xsl:value-of select='$lustrecond'/>
140 <xsl:text> </xsl:text>
141 <fo:basic-link internal-destination="{$id}">
142 <fo:page-number-citation ref-id="{$id}"/>