source: stylesheets/lfs-xsl/pdf/lfs-index.xsl

trunk
Last change on this file was 3626aa30, checked in by Xi Ruoyao <xry111@…>, 3 months ago

Use UTF-8 characters instead of &#...;

This is done via:

find -name \*.xml -or -name \*.xsl | xargs python3 utf8ize.py

with https://linuxfromscratch.org/~xry111/utf8ize.py.

  • Property mode set to 100644
File size: 8.2 KB
Line 
1<?xml version='1.0' encoding='UTF-8'?>
2
3<!DOCTYPE xsl:stylesheet [
4<!ENTITY lowercase "'AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ'">
5<!ENTITY uppercase "'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ'">
6<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'>
7<!ENTITY scope "count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))">
8]>
9
10<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 xmlns:fo="http://www.w3.org/1999/XSL/Format"
12 version="1.0">
13
14 <!-- This stylesheet controls how the Index is generated.
15 Entities comes from {docbook-xsl}/common/entities.ent -->
16
17 <!-- Override for punctuation separating an index term from its list
18 of page references. -->
19 <xsl:param name="index.term.separator" select="': '"></xsl:param>
20
21 <!-- Divisions title properties. -->
22 <xsl:attribute-set name="index.div.title.properties">
23 <xsl:attribute name="margin-left">0pt</xsl:attribute>
24 <xsl:attribute name="font-size">14.4pt</xsl:attribute>
25 <xsl:attribute name="font-family">
26 <xsl:value-of select="$title.fontset"/>
27 </xsl:attribute>
28 <xsl:attribute name="font-weight">bold</xsl:attribute>
29 <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
30 <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
31 <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
32 <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
33 <xsl:attribute name="space-after.optimum">0.5em</xsl:attribute>
34 <xsl:attribute name="space-after.minimum">0.3em</xsl:attribute>
35 <xsl:attribute name="space-after.maximum">0.7em</xsl:attribute>
36 <xsl:attribute name="start-indent">0pt</xsl:attribute>
37 </xsl:attribute-set>
38
39 <!-- Properties applied to the block containing entries in an Index. -->
40 <xsl:attribute-set name="index.entry.properties">
41 <xsl:attribute name="start-indent">0.5pc</xsl:attribute>
42 </xsl:attribute-set>
43
44 <!-- Divisions:
45 Translate alphabetical divisions titles to by-type titles. -->
46 <!-- The original template is in {docbook-xsl}/fo/autoidx.xsl -->
47 <xsl:template match="indexterm" mode="index-div-basic">
48 <xsl:param name="scope" select="."/>
49 <xsl:param name="role" select="''"/>
50 <xsl:param name="type" select="''"/>
51 <xsl:variable name="key"
52 select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
53 <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
54 <xsl:if test="key('letter', $key)[&scope;]
55 [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
56 <fo:block>
57 <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
58 <xsl:call-template name="indexdiv.title">
59 <xsl:with-param name="titlecontent">
60 <xsl:choose>
61 <xsl:when test="$divtitle = 'A'">
62 <xsl:call-template name="gentext">
63 <xsl:with-param name="key">Packages</xsl:with-param>
64 </xsl:call-template>
65 </xsl:when>
66 <xsl:when test="$divtitle = 'B'">
67 <xsl:call-template name="gentext">
68 <xsl:with-param name="key">Programs</xsl:with-param>
69 </xsl:call-template>
70 </xsl:when>
71 <xsl:when test="$divtitle = 'C'">
72 <xsl:call-template name="gentext">
73 <xsl:with-param name="key">Libraries</xsl:with-param>
74 </xsl:call-template>
75 </xsl:when>
76 <xsl:when test="$divtitle = 'D'">
77 <xsl:choose>
78 <xsl:when test="$book-type = 'blfs'">
79 <xsl:call-template name="gentext">
80 <xsl:with-param name="key">Kernel Configuration</xsl:with-param>
81 </xsl:call-template>
82 </xsl:when>
83 <xsl:otherwise>
84 <xsl:call-template name="gentext">
85 <xsl:with-param name="key">Scripts</xsl:with-param>
86 </xsl:call-template>
87 </xsl:otherwise>
88 </xsl:choose>
89 </xsl:when>
90 <xsl:when test="$divtitle = 'E'">
91 <xsl:choose>
92 <xsl:when test="$book-type = 'blfs'">
93 <xsl:call-template name="gentext">
94 <xsl:with-param name="key">Configuration Files</xsl:with-param>
95 </xsl:call-template>
96 </xsl:when>
97 <xsl:otherwise>
98 <xsl:call-template name="gentext">
99 <xsl:with-param name="key">Others</xsl:with-param>
100 </xsl:call-template>
101 </xsl:otherwise>
102 </xsl:choose>
103 </xsl:when>
104 <xsl:when test="$divtitle = 'F'">
105 <xsl:call-template name="gentext">
106 <xsl:with-param name="key">Bootscripts</xsl:with-param>
107 </xsl:call-template>
108 </xsl:when>
109 <xsl:when test="$divtitle = 'G'">
110 <xsl:call-template name="gentext">
111 <xsl:with-param name="key">Others</xsl:with-param>
112 </xsl:call-template>
113 </xsl:when>
114 <xsl:otherwise>
115 <xsl:value-of select="$divtitle"/>
116 </xsl:otherwise>
117 </xsl:choose>
118 </xsl:with-param>
119 </xsl:call-template>
120 </xsl:if>
121 <fo:block xsl:use-attribute-sets="index.entry.properties">
122 <xsl:apply-templates select="key('letter', $key)[&scope;]
123 [count(.|key('primary', &primary;)[&scope;][1])=1]"
124 mode="index-primary">
125 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
126 <xsl:with-param name="scope" select="$scope"/>
127 <xsl:with-param name="role" select="$role"/>
128 <xsl:with-param name="type" select="$type"/>
129 </xsl:apply-templates>
130 </fo:block>
131 </fo:block>
132 </xsl:if>
133 </xsl:template>
134
135</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.