-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfo-stylesheet.xsl
262 lines (230 loc) · 11.3 KB
/
fo-stylesheet.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<xsl:import href="docbook-xsl/fo/docbook.xsl"/>
<xsl:import href="base-stylesheet.xsl"/>
<xsl:param name="fop1.extensions">1</xsl:param>
<xsl:param name="generate.toc">
appendix nop
article nop
book toc,title
chapter nop
part nop
preface nop
qandadiv nop
qandaset nop
reference nop
sect1 nop
sect2 nop
sect3 nop
sect4 nop
sect5 nop
section nop
set nop
</xsl:param>
<xsl:param name="header.image.filename" select="../build/xlestronix-logo.png"/>
<xsl:param name="header.column.widths">1 0 1</xsl:param>
<xsl:param name="marker.section.level" select="1"/>
<xsl:template name="header.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<fo:block>
<!-- sequence can be odd, even, first, blank -->
<!-- position can be left, center, right -->
<xsl:choose>
<!-- First page -->
<xsl:when test="$sequence = 'first' and $position = 'left'">
<!-- <xsl:text>first left</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'first' and $position = 'center'">
<!-- <xsl:text>first center</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'first' and $position = 'right'">
<xsl:value-of select="ancestor-or-self::book/title"/>
</xsl:when>
<!-- Odd page, single sided uses this layout only -->
<xsl:when test="$sequence = 'odd' and $position = 'left'">
<fo:retrieve-marker
retrieve-class-name="section.head.marker"
retrieve-position="first-including-carryover"
retrieve-boundary="page-sequence"/>
</xsl:when>
<xsl:when test="$sequence = 'odd' and $position = 'center'">
<!-- <xsl:call-template name="draft.text"/> -->
</xsl:when>
<xsl:when test="$sequence = 'odd' and $position = 'right'">
<xsl:value-of select="ancestor-or-self::book/title"/>
<!--
<fo:external-graphic content-height="1.2cm">
<xsl:attribute name="src">
<xsl:call-template name="fo-external-image">
<xsl:with-param name="filename" select="$header.image.filename"/>
<xsl:with-param name="filename" select="../build/xlestronix-logo.png"/>
</xsl:call-template>
</xsl:attribute>
</fo:external-graphic>
-->
<!-- <xsl:text>odd right</xsl:text> -->
</xsl:when>
<!-- Even page, only used in double sided -->
<xsl:when test="$sequence = 'even' and $position = 'left'">
<xsl:text>The (Chinese) Radio Documentation Project</xsl:text>
</xsl:when>
<xsl:when test="$sequence = 'even' and $position = 'center'">
<xsl:call-template name="draft.text"/>
</xsl:when>
<xsl:when test="$sequence = 'even' and $position = 'right'">
<!-- <xsl:apply-templates select="." mode="titleabbrev.markup"/> -->
</xsl:when>
<!-- Blank page, only used in double sided -->
<xsl:when test="$sequence = 'blank' and $position = 'left'">
<xsl:text>The (Chinese) Radio Documentation Project</xsl:text>
<!-- <xsl:text>blank left</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'blank' and $position = 'center'">
<!-- <xsl:text>This page intentionally left blank</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'blank' and $position = 'right'">
<!-- <xsl:apply-templates select="." mode="titleabbrev.markup"/> -->
</xsl:when>
</xsl:choose>
</fo:block>
</xsl:template>
<xsl:param name="footer.column.widths">1 0 1</xsl:param>
<xsl:template name="footer.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<fo:block>
<!-- sequence can be odd, even, first, blank -->
<!-- position can be left, center, right -->
<xsl:choose>
<!-- First page -->
<xsl:when test="$sequence = 'first' and $position = 'left'">
<!-- <xsl:text>first left</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'first' and $position = 'center'">
<!-- <xsl:text>first center</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'first' and $position = 'right'">
<!-- <xsl:text>first right</xsl:text> -->
<fo:page-number/>
</xsl:when>
<!-- Odd page, single sided uses this layout only -->
<xsl:when test="$sequence = 'odd' and $position = 'left'">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:when>
<xsl:when test="$sequence = 'odd' and $position = 'center'">
<!-- <xsl:text>odd center</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'odd' and $position = 'right'">
<fo:page-number/>
</xsl:when>
<!-- Even page, only used in double sided -->
<xsl:when test="$sequence = 'even' and $position = 'left'">
<fo:page-number/>
</xsl:when>
<xsl:when test="$sequence = 'even' and $position = 'center'">
<!-- <xsl:text>even center</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'even' and $position = 'right'">
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</xsl:when>
<!-- Blank page, only used in double sided -->
<xsl:when test="$sequence = 'blank' and $position = 'left'">
<fo:page-number/>
</xsl:when>
<xsl:when test="$sequence = 'blank' and $position = 'center'">
<!-- <xsl:text>blank center</xsl:text> -->
</xsl:when>
<xsl:when test="$sequence = 'blank' and $position = 'right'">
<!-- <xsl:text>blank right</xsl:text> -->
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</xsl:when>
</xsl:choose>
</fo:block>
</xsl:template>
<!--
<xsl:template name="book.titlepage.recto">
<fo:block>
<fo:external-graphic src="url(images/logo.png)"/>
</fo:block>
</xsl:template>
<xsl:template match="title">
<xsl:choose>
<xsl:when test="(parent::section)">
<fo:block break-before="page">
<xsl:apply-imports />
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:apply-imports />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-->
<!-- PARAMETER REFERENCE: -->
<!-- http://docbook.sourceforge.net/release/xsl/current/doc/fo/ -->
<!-- Move to FO_XSLTPROC_OPTS for support fop1 and xep, etc.
<xsl:param name="fop.extensions" select="1" />
-->
<!-- xsltproc can't support these extensions
<xsl:param name="use.extensions">1</xsl:param>
<xsl:param name="callouts.extension">1</xsl:param>
<xsl:param name="linenumbering.extension">1</xsl:param>
<xsl:param name="tablecolumns.extension">1</xsl:param>
<xsl:param name="textinsert.extension">1</xsl:param>
-->
<!-- Page related Settings -->
<!--
<xsl:param name="double.sided" select="1" />
<xsl:param name="title.margin.left">0pt</xsl:param>
<xsl:param name="body.start.indent">0pt</xsl:param>
<xsl:param name="body.end.indent">0pt</xsl:param>
<fo:simple-page-master master-name="A4" page-width="297mm"
page-height="210mm" margin-top="1cm" margin-bottom="1cm"
margin-left="1cm" margin-right="1cm">
<fo:region-body margin="3cm"/>
<fo:region-before extent="2cm"/>
<fo:region-after extent="2cm"/>
<fo:region-start extent="2cm"/>
<fo:region-end extent="2cm"/>
</fo:simple-page-master>
-->
<!-- Custom font settings
<xsl:param name="title.font.family">sans-serif,SimHei</xsl:param>
<xsl:param name="body.font.family">serif,SimSun</xsl:param>
<xsl:param name="sans.font.family">sans-serif,SimHei</xsl:param>
<xsl:param name="dingbat.font.family">serif,SimSun</xsl:param>
<xsl:param name="monospace.font.family">monospace,FangSong,SimSun</xsl:param>
-->
<!-- Admonitions and callouts settings
<xsl:param name="admon.textlabel" select="0" />
<xsl:param name="admon.graphics" select="1" />
<xsl:param name="admon.graphics.path">images/</xsl:param>
<xsl:param name="admon.graphics.extension">.png</xsl:param>
<xsl:param name="callout.graphics" select="1" />
<xsl:param name="callout.graphics.extension">.png</xsl:param>
<xsl:param name="variablelist.as.blocks" select="1" />
-->
<!-- Uncomment this to enable auto-numbering of sections -->
<!-- xsl:param name="section.autolabel" select="1" / -->
<!-- Breaking long lines
<xsl:param name="hyphenate.verbatim">0</xsl:param>
<xsl:attribute-set name="monospace.verbatim.properties"
use-attribute-sets="verbatim.properties monospace.properties">
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
<xsl:attribute name="hyphenation-character">►</xsl:attribute>
</xsl:attribute-set>
-->
<!--
<xsl:attribute-set name="sidebar.properties" use-attribute-sets="formal.object.properties">
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">.1mm</xsl:attribute>
<xsl:attribute name="background-color">#EEEEEE</xsl:attribute>
</xsl:attribute-set>
-->
</xsl:stylesheet>