1
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
xmlns:yelp="http://www.gnome.org/yelp/ns"
4
xmlns="http://www.w3.org/1999/xhtml"
5
extension-element-prefixes="yelp"
8
<xsl:import href="@XSL_GETTEXT@"/>
10
<xsl:param name="help_icon"/>
11
<xsl:param name="help_icon_size"/>
13
<xsl:param name="theme.color.text"/>
14
<xsl:param name="theme.color.background"/>
15
<xsl:param name="theme.color.text_light"/>
16
<xsl:param name="theme.color.link"/>
17
<xsl:param name="theme.color.link_visited"/>
18
<xsl:param name="theme.color.gray_background"/>
19
<xsl:param name="theme.color.gray_border"/>
20
<xsl:param name="theme.color.blue_background"/>
21
<xsl:param name="theme.color.blue_border"/>
22
<xsl:param name="theme.color.red_background"/>
23
<xsl:param name="theme.color.red_border"/>
24
<xsl:param name="theme.color.yellow_background"/>
25
<xsl:param name="theme.color.yellow_border"/>
27
<xsl:template match="toc">
28
<xsl:variable name="direction">
29
<xsl:call-template name="l10n.direction"/>
31
<xsl:variable name="left">
32
<xsl:call-template name="l10n.align.start">
33
<xsl:with-param name="direction" select="$direction"/>
36
<xsl:variable name="right">
37
<xsl:call-template name="l10n.align.end">
38
<xsl:with-param name="direction" select="$direction"/>
41
<yelp:document href="{@id}">
45
<xsl:value-of select="title[1]"/>
47
<style type="text/css"><xsl:text>
58
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 204px;
60
padding-bottom: 0.2em;
61
-webkit-border-radius: 6px;
62
border: solid 1px </xsl:text>
63
<xsl:value-of select="$theme.color.blue_border"/><xsl:text>;
64
background-color: </xsl:text>
65
<xsl:value-of select="$theme.color.blue_background"/><xsl:text>;
67
<xsl:value-of select="$theme.color.text"/><xsl:text>;
70
float: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
71
margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 18px;
74
color: </xsl:text><xsl:value-of select="$theme.color.text"/><xsl:text>;
76
div[class~="body"] { }
77
div[class~="leftbar"] {
80
</xsl:text><xsl:value-of select="$left"/><xsl:text>: 12px;
83
text-align: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
84
/* padding-top: </xsl:text>
85
<xsl:value-of select="$help_icon_size"/><xsl:text>px;
86
background-image: url("</xsl:text>
87
<xsl:value-of select="$help_icon"/><xsl:text>");
88
background-position: </xsl:text>
89
<xsl:value-of select="(192 - $help_icon_size) div 2"/><xsl:text>px 0px;
90
background-repeat: no-repeat;
93
div[class~="leftbackground"] {
96
</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1px;
101
background-image:url("</xsl:text>
102
<xsl:value-of select="$help_icon"/><xsl:text>");
103
background-position: </xsl:text>
104
<xsl:value-of select="(192 - $help_icon_size) div 2"/><xsl:text>px 0px;
106
background-repeat: no-repeat;
109
div[class~="rightbar"] {
110
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 216px;
111
margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 12px;
113
background-color: </xsl:text><xsl:value-of select="$theme.color.background"/><xsl:text>;
114
color: </xsl:text><xsl:value-of select="$theme.color.text"/><xsl:text>;
115
-webkit-border-radius: 8px;
117
ul { margin-left: 0em; padding-left: 0em; }
118
li[class~="toclist"] {
120
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0em;
121
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0em;
123
list-style-type: none;
125
li li[class~="toclist"] {
126
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0.8em;
129
li li li[class~="toclist"] {
130
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0.8em;
134
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0em;
137
list-style-type: none;
140
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0em;
141
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0em;
143
dt { font-size: 1.2em; margin-top: 1em; }
145
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
148
a { text-decoration: none; color: </xsl:text><xsl:value-of select="$theme.color.link"/><xsl:text>; }
149
a:hover { text-decoration: underline; }
154
<xsl:if test="$direction = 'ltr' or $direction='rtl'">
155
<xsl:attribute name="dir">
156
<xsl:value-of select="$direction"/>
159
<xsl:apply-templates mode="body.mode" select="."/>
166
<xsl:template name="print.documents">
169
<xsl:for-each select="doc">
170
<xsl:sort order="ascending" data-type="number"
171
select="normalize-space(@weight)"/>
172
<xsl:sort select="normalize-space(title)"/>
174
<a href="{@href}" title="{@href}">
175
<xsl:if test="tooltip">
176
<xsl:attribute name="title">
177
<xsl:value-of select="tooltip"/>
180
<xsl:value-of select="title"/>
184
<xsl:value-of select="description"/>
191
<xsl:template name="print.subsections">
194
<xsl:for-each select="toc[../@id = 'index' or .//doc]">
195
<xsl:sort select="number(../@id = 'index') * position()"/>
196
<xsl:sort select="normalize-space(title)"/>
198
<a href="x-yelp-toc:{@id}">
199
<xsl:apply-templates select="title[1]/node()"/>
207
<xsl:template mode="body.mode" match="toc">
208
<div class="leftbackground">
213
<img src="{icon/@file}"/>
215
<xsl:apply-templates select="title"/>
217
<div class="leftbar">
219
<xsl:when test="@id= 'index'">
220
<h2><xsl:value-of select="/toc/title"/></h2>
223
<a href="x-yelp-toc:index"><h2><xsl:value-of select="/toc/title"/>
227
<xsl:apply-templates mode="leftbar.mode" select="/toc">
228
<xsl:with-param name="curid" select="@id"/>
229
</xsl:apply-templates>
231
<div class="rightbar">
232
<h3><xsl:apply-templates select="description/node()"/></h3>
234
<!-- if there are documents and subsections, only print documents -->
235
<xsl:when test="doc[1] and toc[.//doc[1]]">
236
<xsl:call-template name="print.documents"/>
238
<!-- if there are documents, print them -->
239
<xsl:when test="doc[1]">
240
<xsl:call-template name="print.documents"/>
242
<!-- if there are subsections, print them -->
243
<xsl:when test="toc[.//doc[1]]">
244
<xsl:call-template name="print.subsections"/>
247
<h3>No documents or subcategories found.</h3>
254
<!-- tricky recursive xslt -->
255
<xsl:template mode="leftbar.mode" match="toc">
256
<xsl:param name="curid" select="0"/>
258
<xsl:for-each select="toc[.//doc[1] or @protected]">
261
<xsl:when test="@id != $curid">
262
<a href="x-yelp-toc:{@id}">
263
<xsl:value-of select="title[1]/node()"/>
267
<xsl:value-of select="title[1]/node()"/>
270
<xsl:if test="@id = $curid or .//toc[@id = $curid]">
271
<xsl:apply-templates mode="leftbar.mode" select=".">
272
<xsl:with-param name="curid" select="$curid"/>
273
</xsl:apply-templates>
280
<xsl:template match="/">
281
<xsl:apply-templates select="//toc" />