source: stylesheets/lfs-xsl/xhtml/lfs-mixed.xsl@ 52dcb7d

11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 52dcb7d was 52dcb7d, checked in by Xℹ Ruoyao <xry111@…>, 3 years ago

remove $Date$ and $LastChangedBy$

They are unsupported by Git.

  • Property mode set to 100644
File size: 11.0 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns="http://www.w3.org/1999/xhtml"
5 version="1.0">
6
7 <!-- This stylesheet contains misc templates for output formating.
8 This file is for that templates that don't fit in other files
9 and that not afect the chunk algorithm. -->
10
11 <!-- Individual elements templates -->
12
13 <!-- para:
14 Added a choose to skip empty "Home page" in packages.xml.
15 Added an if for HLFS features. -->
16 <!-- The original template is in {docbook-xsl}/xhtml/block.xsl -->
17 <xsl:template match="para">
18 <xsl:choose>
19 <xsl:when test="child::ulink[@url=' ']"/>
20 <xsl:otherwise>
21 <xsl:call-template name="paragraph">
22 <xsl:with-param name="class">
23 <xsl:if test="@role">
24 <xsl:if test="$book-type = 'hlfs'">
25 <xsl:if test="contains($hlfs-features,concat(',',@role,','))">
26 <xsl:text>feature-</xsl:text>
27 </xsl:if>
28 </xsl:if>
29 <xsl:value-of select="@role"/>
30 </xsl:if>
31 </xsl:with-param>
32 <xsl:with-param name="content">
33 <xsl:if test="position() = 1 and parent::listitem">
34 <xsl:call-template name="anchor">
35 <xsl:with-param name="node" select="parent::listitem"/>
36 </xsl:call-template>
37 </xsl:if>
38 <xsl:call-template name="anchor"/>
39 <xsl:apply-templates/>
40 </xsl:with-param>
41 </xsl:call-template>
42 </xsl:otherwise>
43 </xsl:choose>
44 </xsl:template>
45
46 <!-- screen:
47 Changed class attribute asignament to fit our look needs.
48 Removed unused line numbering support. -->
49 <!-- The original template is in {docbook-xsl}/xhtml/verbatim.xsl
50 It match also programlisting and synopsis. The code for that tags
51 is unchanged. -->
52 <xsl:template match="screen">
53 <pre>
54 <xsl:attribute name="class">
55 <xsl:choose>
56 <xsl:when test="@role and not(@role = 'nodump')">
57 <xsl:if test="$book-type = 'hlfs'">
58 <xsl:if test="contains($hlfs-features,concat(',',@role,','))">
59 <xsl:text>feature-</xsl:text>
60 </xsl:if>
61 </xsl:if>
62 <xsl:value-of select="@role"/>
63 </xsl:when>
64 <xsl:when test="child::* = userinput">userinput</xsl:when>
65 <xsl:otherwise>
66 <xsl:value-of select="name(.)"/>
67 </xsl:otherwise>
68 </xsl:choose>
69 </xsl:attribute>
70 <xsl:apply-templates/>
71 </pre>
72 </xsl:template>
73
74 <!-- userinput:
75 Using a customized output when inside screen.
76 In other cases, use the original template. -->
77 <!-- The original template is in {docbook-xsl}/xhtml/inline.xsl -->
78 <xsl:template match="userinput">
79 <xsl:choose>
80 <xsl:when test="ancestor::screen">
81 <kbd class="command">
82 <xsl:apply-templates/>
83 </kbd>
84 </xsl:when>
85 <xsl:otherwise>
86 <xsl:apply-imports/>
87 </xsl:otherwise>
88 </xsl:choose>
89 </xsl:template>
90
91 <!-- itemizadlist:
92 @compact is not allowed in XHTML 1.0 Strict DTD. Changing it
93 to @class. -->
94 <!-- The original template is in {docbook-xsl}/xhtml/lists.xsl -->
95 <xsl:template match="itemizedlist">
96 <div>
97 <xsl:apply-templates select="." mode="class.attribute"/>
98 <xsl:call-template name="anchor"/>
99 <xsl:if test="title">
100 <xsl:call-template name="formal.object.heading"/>
101 </xsl:if>
102 <xsl:apply-templates select="*[not(self::listitem or self::title
103 or self::titleabbrev)]
104 |comment()[not(preceding-sibling::listitem)]
105 |processing-instruction()[not(preceding-sibling::listitem)]"/>
106 <ul>
107 <xsl:if test="@spacing='compact'">
108 <xsl:attribute name="class">
109 <xsl:value-of select="@spacing"/>
110 </xsl:attribute>
111 </xsl:if>
112 <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem]
113 |processing-instruction()[preceding-sibling::listitem]"/>
114 </ul>
115 </div>
116 </xsl:template>
117
118 <!-- orderedlist:
119 @start, @type, and @compact sre not allowed in XHTML 1.0 Strict DTD.
120 @start and @type can be replaced by CSS code.
121 Changing @compact to @class. -->
122 <!-- The original template is in {docbook-xsl}/xhtml/lists.xsl -->
123 <xsl:template match="orderedlist">
124 <div>
125 <xsl:apply-templates select="." mode="class.attribute"/>
126 <xsl:call-template name="anchor"/>
127 <xsl:if test="title">
128 <xsl:call-template name="formal.object.heading"/>
129 </xsl:if>
130 <xsl:apply-templates select="*[not(self::listitem or self::title
131 or self::titleabbrev)]
132 |comment()[not(preceding-sibling::listitem)]
133 |processing-instruction()[not(preceding-sibling::listitem)]"/>
134 <ol>
135 <xsl:if test="@spacing='compact'">
136 <xsl:attribute name="class">
137 <xsl:value-of select="@spacing"/>
138 </xsl:attribute>
139 </xsl:if>
140 <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem]
141 |processing-instruction()[preceding-sibling::listitem]"/>
142 </ol>
143 </div>
144 </xsl:template>
145
146 <!-- seg in segementedlist:
147 Added a span around seg text to can match it with CSS code. -->
148 <!-- The original template is in {docbook-xsl}/xhtml/lists.xsl -->
149 <xsl:template match="seg">
150 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
151 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
152 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
153 <!-- Note: segtitle is only going to be the right thing in a well formed
154 SegmentedList. If there are too many Segs or too few SegTitles,
155 you'll get something odd...maybe an error -->
156 <div class="seg">
157 <strong class="segtitle">
158 <xsl:apply-templates select="$segtitles[$segnum=position()]"
159 mode="segtitle-in-seg"/>
160 <xsl:text>: </xsl:text>
161 </strong>
162 <span class="segbody">
163 <xsl:if test="@id">
164 <a id="{@id}" name="{@id}"/>
165 </xsl:if>
166 <xsl:apply-templates/>
167 </span>
168 </div>
169 </xsl:template>
170
171 <!-- variablelist:
172 If it have a role attribute, wrap the default output into a div with
173 a class attribute matching that role attribute.
174 Apply the original template in all cases. -->
175 <!-- The original template is in {docbook-xsl}/xhtml/lists.xsl -->
176 <xsl:template match="variablelist">
177 <xsl:choose>
178 <xsl:when test="@role">
179 <div class="{@role}">
180 <xsl:apply-imports/>
181 </div>
182 </xsl:when>
183 <xsl:otherwise>
184 <xsl:apply-imports/>
185 </xsl:otherwise>
186 </xsl:choose>
187 </xsl:template>
188
189 <!-- para/simplelist:
190 Self-made template. Add a line break and process the childs.
191 If @type is specified, the original templates should be used,
192 but not tested. -->
193 <xsl:template match="para/simplelist">
194 <br/>
195 <xsl:apply-templates mode="condensed"/>
196 </xsl:template>
197
198 <!-- member:
199 Self-made template to process it and add a line break. -->
200 <xsl:template match="member" mode="condensed">
201 <xsl:call-template name="anchor"/>
202 <xsl:call-template name="simple.xlink">
203 <xsl:with-param name="content">
204 <xsl:apply-templates/>
205 </xsl:with-param>
206 </xsl:call-template>
207 <br/>
208 </xsl:template>
209
210
211 <!-- Named formating templates -->
212
213 <!-- Body attributes:
214 Add to the body XHTML output tag a class attribute with the book type
215 and a id attribute with the book type and version. -->
216 <!-- The original template is in {docbook-xsl}/xhtml/docbook.xsl -->
217 <xsl:template name="body.attributes">
218 <xsl:attribute name="class">
219 <xsl:value-of select="$book-type"/>
220 </xsl:attribute>
221 <xsl:attribute name="id">
222 <xsl:value-of select="$book-type"/>
223 <xsl:text>-</xsl:text>
224 <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
225 </xsl:attribute>
226 </xsl:template>
227
228 <!-- Revision History -->
229
230 <!-- revhistory mode titlepage.mode:
231 Removed hardcoded style attributes.
232 Removed support for separate revhistory file. -->
233 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.xsl -->
234 <xsl:template match="revhistory" mode="titlepage.mode">
235 <xsl:variable name="numcols">
236 <xsl:choose>
237 <xsl:when test="//authorinitials">4</xsl:when>
238 <xsl:otherwise>3</xsl:otherwise>
239 </xsl:choose>
240 </xsl:variable>
241 <xsl:variable name="title">
242 <xsl:call-template name="gentext">
243 <xsl:with-param name="key">RevHistory</xsl:with-param>
244 </xsl:call-template>
245 </xsl:variable>
246 <xsl:variable name="contents">
247 <table summary="{$title}" class="{name(.)}">
248 <tr>
249 <th colspan="{$numcols}">
250 <b>
251 <xsl:value-of select="$title"/>
252 </b>
253 </th>
254 </tr>
255 <xsl:apply-templates mode="titlepage.mode">
256 <xsl:with-param name="numcols" select="$numcols"/>
257 </xsl:apply-templates>
258 </table>
259 </xsl:variable>
260 <xsl:copy-of select="$contents"/>
261 </xsl:template>
262
263 <!-- revhistory/revision mode titlepage.mode:
264 Removed hardcoded style attributes. -->
265 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.xsl -->
266 <xsl:template match="revhistory/revision" mode="titlepage.mode">
267 <xsl:param name="numcols" select="'3'"/>
268 <xsl:variable name="revnumber" select="revnumber"/>
269 <xsl:variable name="revdate" select="date"/>
270 <xsl:variable name="revauthor" select="authorinitials|author"/>
271 <xsl:variable name="revremark" select="revremark|revdescription"/>
272 <tr>
273 <td>
274 <xsl:if test="$revnumber">
275 <xsl:call-template name="gentext">
276 <xsl:with-param name="key" select="'Revision'"/>
277 </xsl:call-template>
278 <xsl:call-template name="gentext.space"/>
279 <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/>
280 </xsl:if>
281 </td>
282 <td>
283 <xsl:apply-templates select="$revdate[1]" mode="titlepage.mode"/>
284 </td>
285 <xsl:choose>
286 <xsl:when test="$revauthor">
287 <td>
288 <xsl:for-each select="$revauthor">
289 <xsl:apply-templates select="." mode="titlepage.mode"/>
290 <xsl:if test="position() != last()">
291 <xsl:text>, </xsl:text>
292 </xsl:if>
293 </xsl:for-each>
294 </td>
295 </xsl:when>
296 <xsl:when test="$numcols &gt; 3">
297 <td>&#160;</td>
298 </xsl:when>
299 <xsl:otherwise/>
300 </xsl:choose>
301 <td>
302 <xsl:apply-templates select="$revremark[1]" mode="titlepage.mode"/>
303 </td>
304 </tr>
305 </xsl:template>
306
307</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.