-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathdocbook.xsl
212 lines (170 loc) · 6.85 KB
/
docbook.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
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:hl="http://xslthl.sf.net"
version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunkfast.xsl"/>
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/highlight.xsl"/>
<xsl:param name="use.id.as.filename" select="'1'"/>
<xsl:param name="chunk.quietly" select="1"/>
<xsl:param name="generate.revhistory.link" select="1"></xsl:param>
<xsl:param name="generate.toc">
article toc,title
</xsl:param>
<xsl:param name="html.stylesheet">style.css</xsl:param>
<!-- Layout -->
<!--
We do not center the formal objects, because the tables cannot be
centered with in FOP. So we stick with left aligned formal object. For
left aligned formal objects the caption is best put before the object.
-->
<xsl:param name="body.start.indent">0pt</xsl:param>
<xsl:param name="formal.title.placement">
figure before
example before
equation before
table before
procedure before
</xsl:param>
<xsl:attribute-set name="figure.properties"
use-attribute-sets="formal.object.properties"/>
<xsl:attribute-set name="formal.object.properties">
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="list.block.spacing">
<xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.4em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="list.item.spacing">
<xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.4em</xsl:attribute>
</xsl:attribute-set>
<!-- Typography -->
<xsl:param name="section.autolabel">1</xsl:param>
<!-- We would like to call our examples as listings -->
<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:gentext key="Example" text="Listing"/>
<l:gentext key="example" text="Listing"/>
<l:gentext key="ListofExamples" text="List of Listings"/>
<l:gentext key="listofexamples" text="List of Listings"/>
<l:context name="title">
<l:template name="example" text="Listing %n. %t"/>
</l:context>
<l:context name="xref">
<l:template name="example" text="%t"/>
</l:context>
<l:context name="xref-number">
<l:template name="example" text="Listing %n"/>
</l:context>
<l:context name="xref-number-and-title">
<l:template name="example" text="Listing %n, “%t”"/>
</l:context>
</l:l10n>
</l:i18n>
<!-- Source Highlight -->
<xsl:param name="highlight.source" select="1"></xsl:param>
<xsl:template match='hl:comment' mode="xslthl">
<i class="hl-comment" style="color: #888"><xsl:apply-templates mode="xslthl"/></i>
</xsl:template>
<!-- A grey background for our listings, gives a better indication of
where the code starts and where it ends. -->
<xsl:param name="callout.graphics" select="0"></xsl:param>
<xsl:param name="callout.unicode" select="1"></xsl:param>
<xsl:param name="css.decoration" select="1"></xsl:param>
<xsl:param name="admon.graphics" select="1"></xsl:param>
<xsl:param name="navig.graphics" select="1"></xsl:param>
<xsl:param name="admon.graphics.extension" select="'.png'"></xsl:param>
<xsl:param name="navig.graphics.extension" select="'.png'"></xsl:param>
<xsl:template match="programlisting|screen|synopsis">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:call-template name="anchor"/>
<xsl:if test="$shade.verbatim != 0">
<xsl:message>
<xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
<xsl:text>Use CSS instead,</xsl:text>
</xsl:message>
<xsl:message>
<xsl:text>for example: pre.</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> { background-color: #E0E0E0; }</xsl:text>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="$suppress-numbers = '0'
and @linenumbering = 'numbered'
and $use.extensions != '0'
and $linenumbering.extension != '0'">
<xsl:variable name="rtf">
<xsl:call-template name="apply-highlighting"/>
</xsl:variable>
<pre class="{name(.)}"><code class="{@language}">
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</code></pre>
</xsl:when>
<xsl:otherwise>
<pre class="{name(.)}"><code class="{@language}">
<xsl:call-template name="apply-highlighting"/>
</code></pre>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="user.head.content">
<link href="revision.rss" type="application/rss+xml" rel="alternate" title="Revision updates" />
</xsl:template>
<xsl:template name="chunk-element-content">
<xsl:param name="prev"/>
<xsl:param name="next"/>
<xsl:param name="nav.context"/>
<xsl:param name="content">
<xsl:apply-imports/>
</xsl:param>
<xsl:call-template name="user.preroot"/>
<html>
<xsl:call-template name="html.head">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
</xsl:call-template>
<body>
<xsl:call-template name="body.attributes"/>
<div class="body">
<span id="forkongithub">
<a href="https://github.com/bravegnu/gnu-eprog">Fork me on GitHub</a>
</span>
<xsl:call-template name="user.header.navigation"/>
<xsl:call-template name="header.navigation">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
<xsl:with-param name="nav.context" select="$nav.context"/>
</xsl:call-template>
<xsl:call-template name="user.header.content"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="user.footer.content"/>
<xsl:call-template name="footer.navigation">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
<xsl:with-param name="nav.context" select="$nav.context"/>
</xsl:call-template>
<xsl:call-template name="user.footer.navigation"/>
</div>
</body>
</html>
<xsl:value-of select="$chunk.append"/>
</xsl:template>
</xsl:stylesheet>