source: stylesheets/xhtml/lfs-index.xsl@ e7ce829

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.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 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 e7ce829 was e7ce829, checked in by Bruce Dubbs <bdubbs@…>, 19 years ago

Updates to stylesheeds from Manuel

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

  • Property mode set to 100644
File size: 8.9 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 </div>
35 </xsl:template>
36
37 <!--Divisions-->
38 <xsl:template match="indexterm" mode="index-div">
39 <xsl:param name="scope" select="."/>
40 <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
41 <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
42 <!-- Make sure that we don't generate a div if there are no terms in scope -->
43 <xsl:if test="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
44 <div class="indexdiv">
45 <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
46 <h2>
47 <xsl:choose>
48 <xsl:when test="$divtitle = 'A'">
49 <xsl:call-template name="gentext">
50 <xsl:with-param name="key">Packages</xsl:with-param>
51 </xsl:call-template>
52 </xsl:when>
53 <xsl:when test="$divtitle = 'B'">
54 <xsl:call-template name="gentext">
55 <xsl:with-param name="key">Programs</xsl:with-param>
56 </xsl:call-template>
57 </xsl:when>
58 <xsl:when test="$divtitle = 'C'">
59 <xsl:call-template name="gentext">
60 <xsl:with-param name="key">Libraries</xsl:with-param>
61 </xsl:call-template>
62 </xsl:when>
63 <xsl:when test="$divtitle = 'D'">
64 <xsl:call-template name="gentext">
65 <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
66 </xsl:call-template>
67 </xsl:when>
68 <xsl:when test="$divtitle = 'E'">
69 <xsl:call-template name="gentext">
70 <xsl:with-param name="key">Configuration Files</xsl:with-param>
71 </xsl:call-template>
72 </xsl:when>
73 <xsl:when test="$divtitle = 'F'">
74 <xsl:call-template name="gentext">
75 <xsl:with-param name="key">Bootscripts</xsl:with-param>
76 </xsl:call-template>
77 </xsl:when>
78 <xsl:when test="$divtitle = 'G'">
79 <xsl:call-template name="gentext">
80 <xsl:with-param name="key">Others</xsl:with-param>
81 </xsl:call-template>
82 </xsl:when>
83 <xsl:otherwise>
84 <xsl:value-of select="$divtitle"/>
85 </xsl:otherwise>
86 </xsl:choose>
87 </h2>
88 </xsl:if>
89 <ul>
90 <xsl:apply-templates select="key('letter', $key)[&scope;]
91 [count(.|key('primary', &primary;)[&scope;][1])=1]" mode="index-primary">
92 <xsl:with-param name="scope" select="$scope"/>
93 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
94 </xsl:apply-templates>
95 </ul>
96 </div>
97 </xsl:if>
98 </xsl:template>
99
100 <!-- Dropping the separator from here-->
101 <xsl:template match="indexterm" mode="reference">
102 <xsl:param name="scope" select="."/>
103 <xsl:call-template name="reference">
104 <xsl:with-param name="zones" select="normalize-space(@zone)"/>
105 <xsl:with-param name="scope" select="$scope"/>
106 </xsl:call-template>
107 </xsl:template>
108
109 <!-- Changing the output tags and re-addind the separator-->
110 <xsl:template match="indexterm" mode="index-primary">
111 <xsl:param name="scope" select="."/>
112 <xsl:variable name="key" select="&primary;"/>
113 <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
114 <li>
115 <strong class="item">
116 <xsl:value-of select="primary"/>
117 <xsl:text>: </xsl:text>
118 </strong><div class='indexref'>
119 <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section',
120 concat($key, &#34; &#34;, generate-id((ancestor-or-self::book |ancestor-or-self::part
121 |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
122 |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
123 |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
124 <xsl:apply-templates select="." mode="reference">
125 <xsl:with-param name="scope" select="$scope"/>
126 </xsl:apply-templates>
127 </xsl:for-each>
128 <xsl:if test="$refs/secondary">
129 <ul>
130 <xsl:apply-templates select="$refs[secondary and count(.|key('secondary',
131 concat($key, &#34; &#34;, normalize-space(concat(secondary/@sortas,
132 secondary[not(@sortas)]))))[&scope;][1]) = 1]" mode="index-secondary">
133 <xsl:with-param name="scope" select="$scope"/>
134 <xsl:sort select="translate(normalize-space(concat(secondary/@sortas,
135 secondary[not(@sortas)])), &lowercase;, &uppercase;)"/>
136 </xsl:apply-templates>
137 </ul>
138 </xsl:if>
139 </div></li>
140 </xsl:template>
141
142 <xsl:template match="indexterm" mode="index-secondary">
143 <xsl:param name="scope" select="."/>
144 <xsl:variable name="key" select="concat(&primary;, &#34; &#34;,
145 normalize-space(concat(secondary/@sortas, secondary[not(@sortas)])))"/>
146 <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
147 <li>
148 <strong class="secitem">
149 <xsl:value-of select="secondary"/>
150 <xsl:text>: </xsl:text>
151 </strong>
152 <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section',
153 concat($key, &#34; &#34;, generate-id((ancestor-or-self::book |ancestor-or-self::part
154 |ancestor-or-self::chapter |ancestor-or-self::appendix |ancestor-or-self::preface
155 |ancestor-or-self::sect1 |ancestor-or-self::sect2 |ancestor-or-self::sect3
156 |ancestor-or-self::sect4 |ancestor-or-self::sect5 |ancestor-or-self::index)[last()])))[&scope;][1])]">
157 <xsl:apply-templates select="." mode="reference">
158 <xsl:with-param name="scope" select="$scope"/>
159 </xsl:apply-templates>
160 </xsl:for-each>
161 </li>
162 </xsl:template>
163
164 <!--Links (This template also fix a bug in the original code)-->
165 <xsl:template name="reference">
166 <xsl:param name="scope" select="."/>
167 <xsl:param name="zones"/>
168 <xsl:choose>
169 <xsl:when test="contains($zones, ' ')">
170 <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
171 <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
172 <xsl:variable name="target" select="key('sections', $zone)[&scope;]"/>
173 <xsl:variable name="target2" select="key('sections', $zone2)[&scope;]"/>
174 <a>
175 <xsl:attribute name="href">
176 <xsl:call-template name="href.target.uri">
177 <xsl:with-param name="object" select="$target[1]"/>
178 </xsl:call-template>
179 </xsl:attribute>
180 <xsl:apply-templates select="$target[1]" mode="index-title-content"/>
181 </a>
182 <xsl:text> -- </xsl:text>
183 <a>
184 <xsl:attribute name="href">
185 <xsl:call-template name="href.target.uri">
186 <xsl:with-param name="object" select="$target2[1]"/>
187 </xsl:call-template>
188 </xsl:attribute>
189 <xsl:call-template name="gentext">
190 <xsl:with-param name="key">description</xsl:with-param>
191 </xsl:call-template>
192 </a><br />
193 </xsl:when>
194 <xsl:otherwise>
195 <xsl:variable name="zone" select="$zones"/>
196 <xsl:variable name="target" select="key('sections', $zone)[&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:otherwise>
206 </xsl:choose>
207 </xsl:template>
208
209 <!-- Dropping unneeded anchors -->
210 <xsl:template match="indexterm"/>
211
212</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.