Changeset 869909a for stylesheets/lfs-xsl/xhtml/lfs-index.xsl
- Timestamp:
- 09/13/2019 05:00:08 PM (5 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 9.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- aecbae4a
- Parents:
- f0baf5d9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/xhtml/lfs-index.xsl
rf0baf5d9 r869909a 36 36 </xsl:template> 37 37 38 <!-- The Index title in the longindex.html page: 39 Removed a lot of code not useful for us. 40 Forced h1 title size. --> 41 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl --> 38 <!-- The Index title in the longindex.html page: 39 Removed a lot of code not useful for us. 40 Forced h1 title size. 41 The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl 42 Use the original template now (as in LFS) 42 43 <xsl:template name="index.titlepage"> 43 44 <h1 class="index"> … … 46 47 </xsl:call-template> 47 48 </h1> 48 </xsl:template> 49 </xsl:template>--> 49 50 50 51 <!--Divisions: … … 132 133 </xsl:if> 133 134 <ul> 134 <xsl:apply-templates select="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1])=1]" 135 mode="index-primary"> 136 <xsl:with-param name="scope" select="$scope"/> 137 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> 138 </xsl:apply-templates> 135 <xsl:apply-templates select="key('letter', $key)[count(ancestor::node()|$scope) = count(ancestor::node())][count(.|key('primary', normalize-space(concat(primary/@sortas, " ", primary)))[count(ancestor::node()|$scope) = count(ancestor::node())][1])=1]" mode="index-primary"> 136 <xsl:with-param name="scope" select="$scope"/> 137 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> 138 </xsl:apply-templates> 139 139 </ul> 140 140 </xsl:if> 141 </xsl:template>142 143 <!-- Dropping $term.separator and $number.separator from here.144 We add our customized ones in the output flow.145 As all our indexterm have @zone attributes, removed a lot of146 unused code. -->147 <!-- The original template is in {docbook-xsl}/xhtml/autoidx.xsl -->148 <xsl:template match="indexterm" mode="reference">149 <xsl:param name="scope" select="."/>150 <xsl:call-template name="reference">151 <xsl:with-param name="zones" select="normalize-space(@zone)"/>152 <xsl:with-param name="scope" select="$scope"/>153 </xsl:call-template>154 141 </xsl:template> 155 142 … … 162 149 <xsl:template match="indexterm" mode="index-primary"> 163 150 <xsl:param name="scope" select="."/> 164 <xsl:variable name="key" select=" &primary;"/>165 <xsl:variable name="refs" select="key('primary', $key)[ &scope;]"/>151 <xsl:variable name="key" select="normalize-space(concat(primary/@sortas, " ", primary))"/> 152 <xsl:variable name="refs" select="key('primary', $key)[count(ancestor::node()|$scope) = count(ancestor::node())]"/> 166 153 <li> 167 154 <strong class="item"> … … 178 165 <xsl:if test="$refs/secondary"> 179 166 <ul> 180 <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" 181 mode="index-secondary"> 167 <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, " ", normalize-space(concat(secondary/@sortas, " ", secondary))))[count(ancestor::node()|$scope) = count(ancestor::node()) ][1]) = 1]" mode="index-secondary"> 182 168 <xsl:with-param name="scope" select="$scope"/> 183 169 <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/> … … 196 182 <xsl:template match="indexterm" mode="index-secondary"> 197 183 <xsl:param name="scope" select="."/> 198 <xsl:variable name="key" select="concat( &primary;, &sep;, &secondary;)"/>199 <xsl:variable name="refs" select="key('secondary', $key)[ &scope;]"/>184 <xsl:variable name="key" select="concat(normalize-space(concat(primary/@sortas, " ", primary)), " ", normalize-space(concat(secondary/@sortas, " ", secondary)))"/> 185 <xsl:variable name="refs" select="key('secondary', $key)[count(ancestor::node()|$scope) = count(ancestor::node())]"/> 200 186 <li> 201 187 <strong class="secitem"> … … 213 199 </xsl:template> 214 200 215 <!-- The target links: 216 Changed links separator. 217 On the second @zone link, we use a fixed string for the text 218 with gentext support. 219 Assume that there is no more than 2 @zone in a indexterm. 220 Use href.target.uri named template to resolve the links. It is faster 221 than the default href.target named template. --> 222 <!-- The original template is in {docbook-xsl}/xhtml/autoidx.xsl --> 201 <!-- Drop $term.separator and $number.separator from here as customized ones 202 are added in the output flow. 203 As all the indexterms in the book have @zone attributes, removed a lot of 204 unused code. 205 The original template is in {docbook-xsl}/xhtml/autoidx.xsl --> 206 <xsl:template match="indexterm" mode="reference"> 207 <xsl:param name="scope" select="."/> 208 <xsl:call-template name="reference"> 209 <xsl:with-param name="zones" select="normalize-space(@zone)"/> 210 <xsl:with-param name="scope" select="$scope"/> 211 </xsl:call-template> 212 </xsl:template> 213 214 <!-- The target links: 215 Changed link separator 216 On the second @zone link, we use a fixed string for the text with gentext 217 support. 218 Assume that there are no more than 2 @zone in a indexterm. 219 Use href.target.uri named template to resolve the links. It is faster 220 than the default href.target named template. 221 The original template is in {docbook-xsl}/xhtml/autoidx.xsl --> 223 222 <xsl:template name="reference"> 224 223 <xsl:param name="scope" select="."/>
Note:
See TracChangeset
for help on using the changeset viewer.