1 <?xml version=
"1.0" encoding=
"UTF-8"?>
4 xmlns =
"http://www.w3.org/1999/xhtml"
5 xmlns:xsl =
"http://www.w3.org/1999/XSL/Transform"
10 doctype-public =
"-//W3C//DTD XHTML 1.0 Transitional//EN"
11 doctype-system =
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
13 media-type =
"text/html"
15 <xsl:param name=
"css" select=
"'styles/plain.css'"/>
16 <xsl:param name=
"title" select=
"'Configuration Documentation'"/>
18 <xsl:variable name=
"typeLookup" select=
"document('../types.xml')/types" />
19 <xsl:variable name=
"usageLookup" select=
"document('../usage.xml')/usage" />
21 <!-- Twiddle this variable to get the columns as even as possible -->
22 <xsl:variable name=
"maxNumberAdjust" select=
"2" />
24 <xsl:template match=
"/">
25 <html lang=
"en" xml:
lang=
"en">
27 <title><xsl:value-of select=
"$title" /> -
<xsl:value-of select=
"/configdoc/title" /></title>
28 <meta http-equiv=
"Content-Type" content=
"text/html;charset=UTF-8" />
29 <link rel=
"stylesheet" type=
"text/css" href=
"{$css}" />
33 <div id=
"library"><xsl:value-of select=
"/configdoc/title" /></div>
34 <h1><xsl:value-of select=
"$title" /></h1>
35 <div id=
"tocContainer">
36 <h2>Table of Contents
</h2>
38 <xsl:apply-templates mode=
"toc">
39 <xsl:with-param name=
"overflowNumber" select=
"round(count(/configdoc/namespace) div 2) + $maxNumberAdjust" />
40 </xsl:apply-templates>
43 <div id=
"typesContainer">
45 <xsl:apply-templates select=
"$typeLookup" mode=
"types" />
47 <xsl:apply-templates />
53 <xsl:template match=
"type" mode=
"types">
54 <div class=
"type-block">
55 <xsl:attribute name=
"id">type-
<xsl:value-of select=
"@id" /></xsl:attribute>
56 <h3><code><xsl:value-of select=
"@id" /></code>:
<xsl:value-of select=
"@name" /></h3>
57 <div class=
"type-description">
58 <xsl:copy-of xmlns:
xhtml=
"http://www.w3.org/1999/xhtml" select=
"xhtml:div/node()" />
63 <xsl:template match=
"title" mode=
"toc" />
64 <xsl:template match=
"namespace" mode=
"toc">
65 <xsl:param name=
"overflowNumber" />
66 <xsl:variable name=
"number"><xsl:number level=
"single" /></xsl:variable>
67 <xsl:variable name=
"directiveNumber"><xsl:number level=
"any" count=
"directive" /></xsl:variable>
68 <xsl:if test=
"count(directive)>0">
70 <!-- BEGIN multicolumn code -->
71 <xsl:if test=
"$number >= $overflowNumber">
72 <xsl:attribute name=
"class">col-
2</xsl:attribute>
74 <xsl:if test=
"$number = $overflowNumber">
75 <xsl:attribute name=
"style">margin-top:-
<xsl:value-of select=
"($number * 2 + $directiveNumber - 3) * 1.2" />em
</xsl:attribute>
77 <!-- END multicolumn code -->
78 <a href=
"#{@id}"><xsl:value-of select=
"name" /></a>
80 <xsl:apply-templates select=
"directive" mode=
"toc">
81 <xsl:with-param name=
"overflowNumber" select=
"$overflowNumber" />
82 </xsl:apply-templates>
84 <xsl:if test=
"$number + 1 = $overflowNumber">
90 <xsl:template match=
"directive" mode=
"toc">
91 <xsl:variable name=
"number">
92 <xsl:number level=
"any" count=
"directive|namespace" />
94 <xsl:if test=
"not(deprecated)">
96 <a href=
"#{@id}"><xsl:value-of select=
"name" /></a>
101 <xsl:template match=
"title" />
103 <xsl:template match=
"namespace">
104 <div class=
"namespace">
105 <xsl:apply-templates />
106 <xsl:if test=
"count(directive)=0">
107 <p>No configuration directives defined for this namespace.
</p>
111 <xsl:template match=
"namespace/name">
112 <h2 id=
"{../@id}"><xsl:value-of select=
"." /></h2>
114 <xsl:template match=
"namespace/description">
115 <div class=
"description">
116 <xsl:copy-of xmlns:
xhtml=
"http://www.w3.org/1999/xhtml" select=
"xhtml:div/node()" />
120 <xsl:template match=
"directive">
122 <xsl:attribute name=
"class"><!--
124 --><xsl:if test=
"deprecated"> deprecated
</xsl:if><!--
126 <xsl:apply-templates>
127 <xsl:with-param name=
"id" select=
"@id" />
128 </xsl:apply-templates>
131 <xsl:template match=
"directive/name">
132 <xsl:param name=
"id" />
133 <xsl:apply-templates select=
"../aliases/alias" mode=
"anchor" />
134 <h3 id=
"{$id}"><xsl:value-of select=
"$id" /></h3>
136 <xsl:template match=
"alias" mode=
"anchor">
140 <!-- Do not pass through -->
141 <xsl:template match=
"alias"></xsl:template>
143 <xsl:template match=
"directive/constraints">
144 <xsl:param name=
"id" />
145 <table class=
"constraints">
146 <xsl:apply-templates />
147 <xsl:if test=
"../aliases/alias">
148 <xsl:apply-templates select=
"../aliases" mode=
"constraints" />
150 <xsl:apply-templates select=
"$usageLookup/directive[@id=$id]" />
153 <xsl:template match=
"directive/aliases" mode=
"constraints">
157 <xsl:for-each select=
"alias">
158 <xsl:if test=
"position()>1">,
</xsl:if>
159 <xsl:value-of select=
"." />
164 <xsl:template match=
"directive/description">
165 <div class=
"description">
166 <xsl:copy-of xmlns:
xhtml=
"http://www.w3.org/1999/xhtml" select=
"xhtml:div/node()" />
169 <xsl:template match=
"directive/deprecated">
170 <div class=
"deprecated-notice">
171 <strong>Warning:
</strong>
172 This directive was deprecated in version
<xsl:value-of select=
"version" />.
173 <a href=
"#{use}">%
<xsl:value-of select=
"use" /></a> should be used instead.
176 <xsl:template match=
"usage/directive">
181 <xsl:apply-templates />
186 <xsl:template match=
"usage/directive/file">
188 <em><xsl:value-of select=
"@name" /></em> on line
<xsl:if test=
"count(line)>1">s
</xsl:if>
189 <xsl:text> </xsl:text>
190 <xsl:for-each select=
"line">
191 <xsl:if test=
"position()>1">,
</xsl:if>
192 <xsl:value-of select=
"." />
197 <xsl:template match=
"constraints/version">
199 <th>Version added
</th>
200 <td><xsl:value-of select=
"." /></td>
203 <xsl:template match=
"constraints/type">
207 <xsl:variable name=
"type" select=
"text()" />
208 <xsl:attribute name=
"class">type type-
<xsl:value-of select=
"$type" /></xsl:attribute>
210 <xsl:attribute name=
"href">#type-
<xsl:value-of select=
"$type" /></xsl:attribute>
211 <xsl:value-of select=
"$typeLookup/type[@id=$type]/@name" />
212 <xsl:if test=
"@allow-null='yes'">
219 <xsl:template match=
"constraints/allowed">
221 <th>Allowed values
</th>
223 <xsl:for-each select=
"value"><!--
224 --><xsl:if test=
"position()>1">,
</xsl:if>
225 "<xsl:value-of select=
"." />"<!--
230 <xsl:template match=
"constraints/default">
233 <td><pre><xsl:value-of select=
"." xml:
space=
"preserve" /></pre></td>
236 <xsl:template match=
"constraints/external">
238 <th>External deps
</th>
241 <xsl:apply-templates />
246 <xsl:template match=
"constraints/external/project">
247 <li><xsl:value-of select=
"." /></li>
252 <!-- vim: et sw=4 sts=4