source: stylesheets/xhtml/lfs-index.xsl@ 6091daf

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 6091daf was 6091daf, checked in by Randy McMurchy <randy@…>, 17 years ago

Removed more extraneous spaces

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6491 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 9.8 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2<!DOCTYPE xsl:stylesheet [
3<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
4<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
5<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
6<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
7]>
8
9<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns="http://www.w3.org/1999/xhtml"
11 version="1.0">
12
13<!--
14$LastChangedBy$
15$Date$
16-->
17
18 <!--Filename-->
19 <xsl:template match="index" mode="recursive-chunk-filename">
20 <xsl:text>longindex.html</xsl:text>
21 </xsl:template>
22
23 <!--Title-->
24 <xsl:param name="index-title">Index</xsl:param>
25
26 <xsl:template match="index" mode="title.markup">
27 <xsl:call-template name="gentext">
28 <xsl:with-param name="key" select="$index-title"/>
29 </xsl:call-template>
30 </xsl:template>
31
32 <xsl:template name="index.titlepage">
33 <div class="titlepage">
34 <h1 class="index">
35 <xsl:call-template name="gentext">
36 <xsl:with-param name="key" select="$index-title"/>
37 </xsl:call-template>
38 </h1>
39 <!-- Temporary addition until index is done
40 <div class="note">
41 <div class="admonhead">
42 <img alt="[Note]" src="../images/note.png" />
43 <h3 class="admontitle">
44 Note
45 </h3>
46 </div>
47 <div class="admonbody">
48 <p>
49 At this time, the index is incomplete. Additional entries
50 will be added as time permits.
51 </p>
52 </div>
53 </div>
54 End temporary addition -->
55 </div>
56 </xsl:template>
57
58 <!--Divisions-->
59 <xsl:template match="indexterm" mode="index-div">
60 <xsl:param name="scope" select="."/>
61 <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
62 <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
63 <!-- Make sure that we don't generate a div if there are no terms in scope -->
64 <xsl:if test="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
65 <div class="indexdiv">
66 <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
67 <h2>
68 <xsl:choose>
69 <xsl:when test="$divtitle = 'A'">
70 <a id="package-index" name="package-index"/>
71 <xsl:call-template name="gentext">
72 <xsl:with-param name="key">Packages</xsl:with-param>
73 </xsl:call-template>
74 </xsl:when>
75 <xsl:when test="$divtitle = 'B'">
76 <a id="program-index" name="program-index"/>
77 <xsl:call-template name="gentext">
78 <xsl:with-param name="key">Programs</xsl:with-param>
79 </xsl:call-template>
80 </xsl:when>
81 <xsl:when test="$divtitle = 'C'">
82 <a id="library-index" name="library-index"/>
83 <xsl:call-template name="gentext">
84 <xsl:with-param name="key">Libraries</xsl:with-param>
85 </xsl:call-template>
86 </xsl:when>
87 <xsl:when test="$divtitle = 'D'">
88 <a id="kernel-config-index" name="kernel-config-index"/>
89 <xsl:call-template name="gentext">
90 <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
91 </xsl:call-template>
92 </xsl:when>
93 <xsl:when test="$divtitle = 'E'">
94 <a id="config-file-index" name="config-file-index"/>
95 <xsl:call-template name="gentext">
96 <xsl:with-param name="key">Configuration Files</xsl:with-param>
97 </xsl:call-template>
98 </xsl:when>
99 <xsl:when test="$divtitle = 'F'">
100 <a id="bootscript-index" name="bootscript-index"/>
101 <xsl:call-template name="gentext">
102 <xsl:with-param name="key">Bootscripts</xsl:with-param>
103 </xsl:call-template>
104 </xsl:when>
105 <xsl:when test="$divtitle = 'G'">
106 <a id="other-index" name="other-index"/>
107 <xsl:call-template name="gentext">
108 <xsl:with-param name="key">Others</xsl:with-param>
109 </xsl:call-template>
110 </xsl:when>
111 <xsl:otherwise>
112 <xsl:value-of select="$divtitle"/>
113 </xsl:otherwise>
114 </xsl:choose>
115 </h2>
116 </xsl:if>
117 <ul>
118 <xsl:apply-templates select="key('letter', $key)[&scope;]
119 [count(.|key('primary', &primary;)[&scope;][1])=1]" mode="index-primary">
120 <xsl:with-param name="scope" select="$scope"/>
121 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
122 </xsl:apply-templates>
123 </ul>
124 </div>
125 </xsl:if>
126 </xsl:template>
127
128 <!-- Dropping the separator from here-->
129 <xsl:template match="indexterm" mode="reference">
130 <xsl:param name="scope" select="."/>
131 <xsl:call-template name="reference">
132 <xsl:with-param name="zones" select="normalize-space(@zone)"/>
133 <xsl:with-param name="scope" select="$scope"/>
134 </xsl:call-template>
135 </xsl:template>
136
137 <!-- Changing the output tags and re-addind the separator-->
138 <xsl:template match="indexterm" mode="index-primary">
139 <xsl:param name="scope" select="."/>
140 <xsl:variable name="key" select="&primary;"/>
141 <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
142 <li>
143 <strong class="item">
144 <xsl:value-of select="primary"/>
145 <xsl:text>: </xsl:text>
146 </strong><div class='indexref'>
147 <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section',
148 concat($key, &#34; &#34;, generate-id((ancestor-or-self::book |ancestor-or-self::part
149 |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
150 |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
151 |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
152 <xsl:apply-templates select="." mode="reference">
153 <xsl:with-param name="scope" select="$scope"/>
154 </xsl:apply-templates>
155 </xsl:for-each>
156 <xsl:if test="$refs/secondary">
157 <ul>
158 <xsl:apply-templates select="$refs[secondary and count(.|key('secondary',
159 concat($key, &#34; &#34;, normalize-space(concat(secondary/@sortas,
160 secondary[not(@sortas)]))))[&scope;][1]) = 1]" mode="index-secondary">
161 <xsl:with-param name="scope" select="$scope"/>
162 <xsl:sort select="translate(normalize-space(concat(secondary/@sortas,
163 secondary[not(@sortas)])), &lowercase;, &uppercase;)"/>
164 </xsl:apply-templates>
165 </ul>
166 </xsl:if>
167 </div></li>
168 </xsl:template>
169
170 <xsl:template match="indexterm" mode="index-secondary">
171 <xsl:param name="scope" select="."/>
172 <xsl:variable name="key" select="concat(&primary;, &#34; &#34;,
173 normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])))"/>
174 <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
175 <li>
176 <strong class="secitem">
177 <xsl:value-of select="secondary"/>
178 <xsl:text>: </xsl:text>
179 </strong>
180 <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section',
181 concat($key, &#34; &#34;, generate-id((ancestor-or-self::book |ancestor-or-self::part
182 |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
183 |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
184 |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
185 <xsl:apply-templates select="." mode="reference">
186 <xsl:with-param name="scope" select="$scope"/>
187 </xsl:apply-templates>
188 </xsl:for-each>
189 </li>
190 </xsl:template>
191
192 <!--Links (This template also fix a bug in the original code)-->
193 <xsl:template name="reference">
194 <xsl:param name="scope" select="."/>
195 <xsl:param name="zones"/>
196 <xsl:choose>
197 <xsl:when test="contains($zones, ' ')">
198 <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
199 <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
200 <xsl:variable name="target" select="key('sections', $zone)[&scope;]"/>
201 <xsl:variable name="target2" select="key('sections', $zone2)[&scope;]"/>
202 <a>
203 <xsl:attribute name="href">
204 <xsl:call-template name="href.target.uri">
205 <xsl:with-param name="object" select="$target[1]"/>
206 </xsl:call-template>
207 </xsl:attribute>
208 <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
209 </a>
210 <xsl:text> -- </xsl:text>
211 <a>
212 <xsl:attribute name="href">
213 <xsl:call-template name="href.target.uri">
214 <xsl:with-param name="object" select="$target2[1]"/>
215 </xsl:call-template>
216 </xsl:attribute>
217 <xsl:call-template name="gentext">
218 <xsl:with-param name="key">description</xsl:with-param>
219 </xsl:call-template>
220 </a><br />
221 </xsl:when>
222 <xsl:otherwise>
223 <xsl:variable name="zone" select="$zones"/>
224 <xsl:variable name="target" select="key('sections', $zone)[&scope;]"/>
225 <a>
226 <xsl:attribute name="href">
227 <xsl:call-template name="href.target.uri">
228 <xsl:with-param name="object" select="$target[1]"/>
229 </xsl:call-template>
230 </xsl:attribute>
231 <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
232 </a>
233 </xsl:otherwise>
234 </xsl:choose>
235 </xsl:template>
236
237 <!-- Dropping unneeded anchors -->
238 <xsl:template match="indexterm"/>
239
240</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.