source: stylesheets/xhtml/lfs-index.xsl@ 845e9193

10.0 10.1 11.0 6.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 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 845e9193 was 845e9193, checked in by Randy McMurchy <randy@…>, 16 years ago

Removed spaces from blank lines and excess spaces from the end of XML data

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