source: stylesheets/pdf/lfs-index.xsl@ 3fe8b511

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 3fe8b511 was 3fe8b511, checked in by Bruce Dubbs <bdubbs@…>, 19 years ago

Update stylesheets and fix Python references

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

  • Property mode set to 100644
File size: 8.0 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 secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'>
7<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
8<!ENTITY sep '" "'>
9]>
10
11<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
12
13<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
14 xmlns:fo="http://www.w3.org/1999/XSL/Format"
15 version="1.0">
16
17 <!--Only one column to fit the table layout-->
18 <xsl:param name="column.count.index" select="1"/>
19
20 <!--Title-->
21 <xsl:template match="index" mode="title.markup">
22 <xsl:text>Index of packages and important installed files</xsl:text>
23 </xsl:template>
24
25 <!-- Divisions-->
26 <xsl:template match="indexterm" mode="index-div">
27 <xsl:param name="scope" select="."/>
28 <xsl:variable name="key"
29 select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
30 <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
31 <xsl:if test="key('letter', $key)[&scope;]
32 [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
33 <fo:block>
34 <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
35 <xsl:call-template name="indexdiv.title">
36 <xsl:with-param name="titlecontent">
37 <xsl:choose>
38 <xsl:when test="$divtitle = 'A'">
39 <xsl:text>Packages</xsl:text>
40 </xsl:when>
41 <xsl:when test="$divtitle = 'B'">
42 <xsl:text>Programs</xsl:text>
43 </xsl:when>
44 <xsl:when test="$divtitle = 'C'">
45 <xsl:text>Libraries</xsl:text>
46 </xsl:when>
47 <xsl:when test="$divtitle = 'D'">
48 <xsl:text>Scripts</xsl:text>
49 </xsl:when>
50 <xsl:when test="$divtitle = 'E'">
51 <xsl:text>Configuration Files</xsl:text>
52 </xsl:when>
53 <xsl:when test="$divtitle = 'F'">
54 <xsl:text>Bootscripts</xsl:text>
55 </xsl:when>
56 <xsl:when test="$divtitle = 'G'">
57 <xsl:text>Others</xsl:text>
58 </xsl:when>
59 <xsl:otherwise>
60 <xsl:value-of select="$divtitle"/>
61 </xsl:otherwise>
62 </xsl:choose>
63 </xsl:with-param>
64 </xsl:call-template>
65 </xsl:if>
66 <fo:table table-layout="fixed" width="100%">
67 <fo:table-column column-number="1" column-width="11em"/>
68 <fo:table-column column-number="2" column-width="19em"/>
69 <fo:table-column column-number="3"/>
70 <fo:table-body>
71 <xsl:apply-templates select="key('letter', $key)[&scope;]
72 [count(.|key('primary', &primary;)[&scope;][1])=1]"
73 mode="index-primary">
74 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
75 <xsl:with-param name="scope" select="$scope"/>
76 </xsl:apply-templates>
77 </fo:table-body>
78 </fo:table>
79 </fo:block>
80 </xsl:if>
81 </xsl:template>
82
83 <!-- Dropping the separator from here -->
84 <xsl:template match="indexterm" mode="reference">
85 <xsl:param name="scope" select="."/>
86 <xsl:call-template name="reference">
87 <xsl:with-param name="zones" select="normalize-space(@zone)"/>
88 <xsl:with-param name="scope" select="$scope"/>
89 </xsl:call-template>
90 </xsl:template>
91
92 <!-- Changing the output tags and re-addind the separator-->
93 <xsl:template match="indexterm" mode="index-primary">
94 <xsl:param name="scope" select="."/>
95 <xsl:variable name="key" select="&primary;"/>
96 <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
97 <fo:table-row>
98 <fo:table-cell>
99 <fo:block>
100 <xsl:value-of select="primary"/>
101 <xsl:text>: </xsl:text>
102 </fo:block>
103 </fo:table-cell>
104 <xsl:for-each select="$refs[not(see) and not(seealso)
105 and not(secondary)]">
106 <xsl:apply-templates select="." mode="reference">
107 <xsl:with-param name="scope" select="$scope"/>
108 </xsl:apply-templates>
109 </xsl:for-each>
110 </fo:table-row>
111 <xsl:if test="$refs/secondary">
112 <xsl:apply-templates select="$refs[secondary and count(.|key('secondary',
113 concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" mode="index-secondary">
114 <xsl:with-param name="scope" select="$scope"/>
115 <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
116 </xsl:apply-templates>
117 </xsl:if>
118 </xsl:template>
119
120 <xsl:template match="indexterm" mode="index-secondary">
121 <xsl:param name="scope" select="."/>
122 <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
123 <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
124 <fo:table-row>
125 <fo:table-cell>
126 <fo:block start-indent="1pc">
127 <xsl:value-of select="secondary"/>
128 <xsl:text>: </xsl:text>
129 </fo:block>
130 </fo:table-cell>
131 <xsl:for-each select="$refs[not(see) and not(seealso) and not(tertiary)]">
132 <xsl:apply-templates select="." mode="reference">
133 <xsl:with-param name="scope" select="$scope"/>
134 </xsl:apply-templates>
135 </xsl:for-each>
136 </fo:table-row>
137 </xsl:template>
138
139 <!-- Targets titles and bookmarks-->
140 <xsl:template name="reference">
141 <xsl:param name="scope" select="."/>
142 <xsl:param name="zones"/>
143 <xsl:choose>
144 <xsl:when test="contains($zones, ' ')">
145 <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
146 <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
147 <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
148 <xsl:variable name="target2" select="key('id', $zone2)[&scope;]"/>
149 <xsl:variable name="id">
150 <xsl:call-template name="object.id">
151 <xsl:with-param name="object" select="$target[1]"/>
152 </xsl:call-template>
153 </xsl:variable>
154 <xsl:variable name="id2">
155 <xsl:call-template name="object.id">
156 <xsl:with-param name="object" select="$target2[1]"/>
157 </xsl:call-template>
158 </xsl:variable>
159 <fo:table-cell>
160 <fo:block>
161 <fo:basic-link internal-destination="{$id}">
162 <xsl:value-of select="$target/title"/>
163 <xsl:apply-templates select="$target" mode="page.citation">
164 <xsl:with-param name="id" select="$id"/>
165 </xsl:apply-templates>
166 </fo:basic-link>
167 </fo:block>
168 </fo:table-cell>
169 <fo:table-cell>
170 <fo:block>
171 <fo:basic-link internal-destination="{$id2}">
172 <xsl:text>description</xsl:text>
173 <xsl:apply-templates select="$target2" mode="page.citation">
174 <xsl:with-param name="id" select="$id2"/>
175 </xsl:apply-templates>
176 </fo:basic-link>
177 </fo:block>
178 </fo:table-cell>
179 </xsl:when>
180 <xsl:otherwise>
181 <xsl:variable name="zone" select="$zones"/>
182 <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
183 <xsl:variable name="id">
184 <xsl:call-template name="object.id">
185 <xsl:with-param name="object" select="$target[1]"/>
186 </xsl:call-template>
187 </xsl:variable>
188 <fo:table-cell>
189 <fo:block>
190 <fo:basic-link internal-destination="{$id}">
191 <xsl:value-of select="$target/title"/>
192 <xsl:apply-templates select="$target" mode="page.citation">
193 <xsl:with-param name="id" select="$id"/>
194 </xsl:apply-templates>
195 </fo:basic-link>
196 </fo:block>
197 </fo:table-cell>
198 </xsl:otherwise>
199 </xsl:choose>
200 </xsl:template>
201
202</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.