source: stylesheets/xhtml/lfs-mixed.xsl@ bab5592

10.0 10.0-rc1 10.1 10.1-rc1 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 12.2 12.2-rc1 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 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/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since bab5592 was bab5592, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Testing a new way to render the Short Description sections.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4669 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 5.9 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 <!-- screen -->
8 <xsl:template match="screen">
9 <xsl:choose>
10 <xsl:when test="child::* = userinput">
11 <pre class="userinput">
12 <xsl:apply-templates/>
13 </pre>
14 </xsl:when>
15 <xsl:otherwise>
16 <pre class="{name(.)}">
17 <xsl:apply-templates/>
18 </pre>
19 </xsl:otherwise>
20 </xsl:choose>
21 </xsl:template>
22
23 <xsl:template match="userinput">
24 <xsl:choose>
25 <xsl:when test="ancestor::screen">
26 <kbd class="command">
27 <xsl:apply-templates/>
28 </kbd>
29 </xsl:when>
30 <xsl:otherwise>
31 <xsl:apply-imports/>
32 </xsl:otherwise>
33 </xsl:choose>
34 </xsl:template>
35
36
37 <!-- variablelist
38 <xsl:template match="variablelist">
39 <div class="{name(.)}">
40 <xsl:if test="title | bridgehead">
41 <xsl:choose>
42 <xsl:when test="@role = 'materials'">
43 <h2>
44 <xsl:value-of select="title | bridgehead"/>
45 </h2>
46 </xsl:when>
47 <xsl:otherwise>
48 <h3>
49 <xsl:value-of select="title | bridgehead"/>
50 </h3>
51 </xsl:otherwise>
52 </xsl:choose>
53 </xsl:if>
54 <dl>
55 <xsl:if test="@role">
56 <xsl:attribute name="class">
57 <xsl:value-of select="@role"/>
58 </xsl:attribute>
59 </xsl:if>
60 <xsl:apply-templates select="varlistentry"/>
61 </dl>
62 </div>
63 </xsl:template>-->
64
65 <!-- segementedlist -->
66 <xsl:template match="seg">
67 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
68 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
69 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
70 <!-- Note: segtitle is only going to be the right thing in a well formed
71 SegmentedList. If there are too many Segs or too few SegTitles,
72 you'll get something odd...maybe an error -->
73 <div class="seg">
74 <strong>
75 <span class="segtitle">
76 <xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/>
77 <xsl:text>: </xsl:text>
78 </span>
79 </strong>
80 <span class="seg">
81 <xsl:apply-templates/>
82 </span>
83 </div>
84 </xsl:template>
85
86 <!-- Body attributes -->
87 <xsl:template name="body.attributes">
88 <xsl:attribute name="id">
89 <xsl:text>lfs</xsl:text>
90 </xsl:attribute>
91 <xsl:attribute name="class">
92 <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
93 </xsl:attribute>
94 </xsl:template>
95
96 <!-- External URLs in italic font -->
97 <xsl:template match="ulink" name="ulink">
98 <a>
99 <xsl:if test="@id">
100 <xsl:attribute name="id">
101 <xsl:value-of select="@id"/>
102 </xsl:attribute>
103 </xsl:if>
104 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
105 <i>
106 <xsl:choose>
107 <xsl:when test="count(child::node())=0">
108 <xsl:value-of select="@url"/>
109 </xsl:when>
110 <xsl:otherwise>
111 <xsl:apply-templates/>
112 </xsl:otherwise>
113 </xsl:choose>
114 </i>
115 </a>
116 </xsl:template>
117
118 <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
119 isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
120 <xsl:template name="inline.monoseq">
121 <xsl:param name="content">
122 <xsl:call-template name="anchor"/>
123 <xsl:call-template name="simple.xlink">
124 <xsl:with-param name="content">
125 <xsl:apply-templates/>
126 </xsl:with-param>
127 </xsl:call-template>
128 </xsl:param>
129 <tt class="{local-name(.)}">
130 <xsl:if test="@dir">
131 <xsl:attribute name="dir">
132 <xsl:value-of select="@dir"/>
133 </xsl:attribute>
134 </xsl:if>
135 <xsl:copy-of select="$content"/>
136 </tt>
137 </xsl:template>
138
139 <xsl:template name="inline.boldmonoseq">
140 <xsl:param name="content">
141 <xsl:call-template name="anchor"/>
142 <xsl:call-template name="simple.xlink">
143 <xsl:with-param name="content">
144 <xsl:apply-templates/>
145 </xsl:with-param>
146 </xsl:call-template>
147 </xsl:param>
148 <!-- don't put <strong> inside figure, example, or table titles -->
149 <!-- or other titles that may already be represented with <strong>'s. -->
150 <xsl:choose>
151 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
152 or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
153 <tt class="{local-name(.)}">
154 <xsl:if test="@dir">
155 <xsl:attribute name="dir">
156 <xsl:value-of select="@dir"/>
157 </xsl:attribute>
158 </xsl:if>
159 <xsl:copy-of select="$content"/>
160 </tt>
161 </xsl:when>
162 <xsl:otherwise>
163 <strong class="{local-name(.)}">
164 <tt>
165 <xsl:if test="@dir">
166 <xsl:attribute name="dir">
167 <xsl:value-of select="@dir"/>
168 </xsl:attribute>
169 </xsl:if>
170 <xsl:copy-of select="$content"/>
171 </tt>
172 </strong>
173 </xsl:otherwise>
174 </xsl:choose>
175 </xsl:template>
176
177 <xsl:template name="inline.italicmonoseq">
178 <xsl:param name="content">
179 <xsl:call-template name="anchor"/>
180 <xsl:call-template name="simple.xlink">
181 <xsl:with-param name="content">
182 <xsl:apply-templates/>
183 </xsl:with-param>
184 </xsl:call-template>
185 </xsl:param>
186 <em class="{local-name(.)}">
187 <tt>
188 <xsl:if test="@dir">
189 <xsl:attribute name="dir">
190 <xsl:value-of select="@dir"/>
191 </xsl:attribute>
192 </xsl:if>
193 <xsl:copy-of select="$content"/>
194 </tt>
195 </em>
196 </xsl:template>
197
198
199</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.