source: stylesheets/lfs-xsl/pdf/lfs-lists.xsl@ 52dcb7d

11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 52dcb7d was 52dcb7d, checked in by Xℹ Ruoyao <xry111@…>, 3 years ago

remove $Date$ and $LastChangedBy$

They are unsupported by Git.

  • Property mode set to 100644
File size: 7.4 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:fo="http://www.w3.org/1999/XSL/Format"
5 version="1.0">
6
7 <!-- This stylesheet controls how list are generated. -->
8
9 <!-- What spacing do you want before and after lists? -->
10 <xsl:attribute-set name="list.block.spacing">
11 <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
12 <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
13 <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
14 <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
15 <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
16 <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
17 </xsl:attribute-set>
18
19 <!-- What spacing do you want between list items? -->
20 <xsl:attribute-set name="list.item.spacing">
21 <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
22 <xsl:attribute name="space-before.minimum">0.2em</xsl:attribute>
23 <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
24 </xsl:attribute-set>
25
26 <!-- Properties that apply to each list-block generated by itemizedlist. -->
27 <xsl:attribute-set name="itemizedlist.properties"
28 use-attribute-sets="list.block.properties">
29 <xsl:attribute name="text-align">left</xsl:attribute>
30 </xsl:attribute-set>
31
32 <!-- Format variablelists lists as blocks? 1 = yes, 0 = no
33 Default variablelist format. We override it when necessary
34 using the list-presentation processing instruction. -->
35 <xsl:param name="variablelist.as.blocks" select="1"/>
36
37 <!-- Specifies the longest term in variablelists.
38 Used when list-presentation = list -->
39 <xsl:param name="variablelist.max.termlength">35</xsl:param>
40
41 <!-- varlistentry mode block:
42 Addibg a bullet, left alignament, and @kepp-*.* attributes
43 for packages and paches list. -->
44 <!-- The original template is in {docbook-xsl}/fo/list.xsl -->
45 <xsl:template match="varlistentry" mode="vl.as.blocks">
46 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
47 <xsl:choose>
48 <xsl:when test="ancestor::variablelist/@role = 'materials'">
49 <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
50 keep-together.within-column="always" font-weight="bold"
51 keep-with-next.within-column="always" text-align="left">
52 <xsl:text>&#x2022; </xsl:text>
53 <xsl:apply-templates select="term"/>
54 </fo:block>
55 <fo:block text-align="left"
56 keep-together.within-column="always"
57 keep-with-previous.within-column="always">
58 <xsl:apply-templates select="listitem"/>
59 </fo:block>
60 </xsl:when>
61 <xsl:otherwise>
62 <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
63 keep-together.within-column="always"
64 keep-with-next.within-column="always" margin-left="1em">
65 <xsl:apply-templates select="term"/>
66 </fo:block>
67 <fo:block margin-left="2em">
68 <xsl:apply-templates select="listitem"/>
69 </fo:block>
70 </xsl:otherwise>
71 </xsl:choose>
72 </xsl:template>
73
74 <!-- segmentedlist:
75 Making it an actual FO list to can indent items.
76 Adjust vertical space. -->
77 <!-- The original template is in {docbook-xsl}/fo/list.xsl -->
78 <xsl:template match="segmentedlist">
79 <xsl:variable name="id">
80 <xsl:call-template name="object.id"/>
81 </xsl:variable>
82 <fo:list-block id="{$id}" provisional-distance-between-starts="12em"
83 provisional-label-separation="1em"
84 keep-together.within-column="always">
85 <xsl:choose>
86 <xsl:when test="ancestor::appendix[@id='appendixc']">
87 <xsl:attribute name="space-before.optimum">0.2em</xsl:attribute>
88 <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
89 <xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
90 <xsl:attribute name="space-after.optimum">0.2em</xsl:attribute>
91 <xsl:attribute name="space-after.minimum">0em</xsl:attribute>
92 <xsl:attribute name="space-after.maximum">0.4em</xsl:attribute>
93 <xsl:attribute name="keep-with-previous.within-column">always</xsl:attribute>
94 </xsl:when>
95 <xsl:otherwise>
96 <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
97 <xsl:attribute name="space-before.minimum">0.2em</xsl:attribute>
98 <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
99 <xsl:attribute name="space-after.optimum">0.4em</xsl:attribute>
100 <xsl:attribute name="space-after.minimum">0.2em</xsl:attribute>
101 <xsl:attribute name="space-after.maximum">0.6em</xsl:attribute>
102 </xsl:otherwise>
103 </xsl:choose>
104 <xsl:apply-templates select="seglistitem/seg"/>
105 </fo:list-block>
106 </xsl:template>
107
108 <!-- seg:
109 Self-made template based on the original seg template
110 found in {docbook-xsl}/fo/list.xsl
111 Making segmentedlist an actual FO list to can indent items. -->
112 <xsl:template match="seglistitem/seg">
113 <xsl:variable name="id">
114 <xsl:call-template name="object.id"/>
115 </xsl:variable>
116 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
117 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
118 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
119 <fo:list-item xsl:use-attribute-sets="compact.list.item.spacing">
120 <fo:list-item-label end-indent="label-end()" text-align="start">
121 <fo:block>
122 <fo:inline font-weight="bold">
123 <xsl:apply-templates select="$segtitles[$segnum=position()]"
124 mode="segtitle-in-seg"/>
125 <xsl:text>:</xsl:text>
126 </fo:inline>
127 </fo:block>
128 </fo:list-item-label>
129 <fo:list-item-body start-indent="body-start()">
130 <fo:block id="{$id}">
131 <xsl:apply-templates/>
132 </fo:block>
133 </fo:list-item-body>
134 </fo:list-item>
135 </xsl:template>
136
137 <!-- simplelist:
138 Self-made template. Wrap it into a fo:block and process member childs.
139 If @type is specified, the original templates will be used.
140 NOTE: when using type='horiz' or type='vert', FOP-0.93 will complaints
141 about not supported table-layout="auto" -->
142 <xsl:template match="simplelist">
143 <fo:block xsl:use-attribute-sets="simplelist.properties">
144 <xsl:apply-templates mode="condensed"/>
145 </fo:block>
146 </xsl:template>
147
148 <!-- member:
149 Self-made template to wrap it into a fo:block using customized
150 properties. -->
151 <xsl:template match="member" mode="condensed">
152 <fo:block xsl:use-attribute-sets="simplelist.properties">
153 <xsl:call-template name="simple.xlink">
154 <xsl:with-param name="content">
155 <xsl:apply-templates/>
156 </xsl:with-param>
157 </xsl:call-template>
158 </fo:block>
159 </xsl:template>
160
161 <!-- Properties associated with our simplelist format. -->
162 <xsl:attribute-set name="simplelist.properties">
163 <xsl:attribute name="keep-with-previous.within-column">always</xsl:attribute>
164 <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
165 <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
166 <xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
167 </xsl:attribute-set>
168
169</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.