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 <xsl:apply-templates />
49 <xsl:template match=
"title" mode=
"toc" />
50 <xsl:template match=
"namespace" mode=
"toc">
51 <xsl:param name=
"overflowNumber" />
52 <xsl:variable name=
"number"><xsl:number level=
"single" /></xsl:variable>
53 <xsl:variable name=
"directiveNumber"><xsl:number level=
"any" count=
"directive" /></xsl:variable>
54 <xsl:if test=
"count(directive)>0">
56 <!-- BEGIN multicolumn code -->
57 <xsl:if test=
"$number >= $overflowNumber">
58 <xsl:attribute name=
"class">col-
2</xsl:attribute>
60 <xsl:if test=
"$number = $overflowNumber">
61 <xsl:attribute name=
"style">margin-top:-
<xsl:value-of select=
"($number * 2 + $directiveNumber - 3) * 1.2" />em
</xsl:attribute>
63 <!-- END multicolumn code -->
64 <a href=
"#{@id}"><xsl:value-of select=
"name" /></a>
66 <xsl:apply-templates select=
"directive" mode=
"toc">
67 <xsl:with-param name=
"overflowNumber" select=
"$overflowNumber" />
68 </xsl:apply-templates>
70 <xsl:if test=
"$number + 1 = $overflowNumber">
76 <xsl:template match=
"directive" mode=
"toc">
77 <xsl:variable name=
"number">
78 <xsl:number level=
"any" count=
"directive|namespace" />
80 <xsl:if test=
"not(deprecated)">
82 <a href=
"#{@id}"><xsl:value-of select=
"name" /></a>
87 <xsl:template match=
"title" />
89 <xsl:template match=
"namespace">
90 <div class=
"namespace">
91 <xsl:apply-templates />
92 <xsl:if test=
"count(directive)=0">
93 <p>No configuration directives defined for this namespace.
</p>
97 <xsl:template match=
"namespace/name">
98 <h2 id=
"{../@id}"><xsl:value-of select=
"." /></h2>
100 <xsl:template match=
"namespace/description">
101 <div class=
"description">
102 <xsl:copy-of xmlns:
xhtml=
"http://www.w3.org/1999/xhtml" select=
"xhtml:div/node()" />
106 <xsl:template match=
"directive">
108 <xsl:attribute name=
"class"><!--
110 --><xsl:if test=
"deprecated"> deprecated
</xsl:if><!--
112 <xsl:apply-templates>
113 <xsl:with-param name=
"id" select=
"@id" />
114 </xsl:apply-templates>
117 <xsl:template match=
"directive/name">
118 <xsl:param name=
"id" />
119 <xsl:apply-templates select=
"../aliases/alias" mode=
"anchor" />
120 <h3 id=
"{$id}"><xsl:value-of select=
"$id" /></h3>
122 <xsl:template match=
"alias" mode=
"anchor">
126 <!-- Do not pass through -->
127 <xsl:template match=
"alias"></xsl:template>
129 <xsl:template match=
"directive/constraints">
130 <xsl:param name=
"id" />
131 <table class=
"constraints">
132 <xsl:apply-templates />
133 <xsl:if test=
"../aliases/alias">
134 <xsl:apply-templates select=
"../aliases" mode=
"constraints" />
136 <xsl:apply-templates select=
"$usageLookup/directive[@id=$id]" />
139 <xsl:template match=
"directive/aliases" mode=
"constraints">
143 <xsl:for-each select=
"alias">
144 <xsl:if test=
"position()>1">,
</xsl:if>
145 <xsl:value-of select=
"." />
150 <xsl:template match=
"directive/description">
151 <div class=
"description">
152 <xsl:copy-of xmlns:
xhtml=
"http://www.w3.org/1999/xhtml" select=
"xhtml:div/node()" />
155 <xsl:template match=
"directive/deprecated">
156 <div class=
"deprecated-notice">
157 <strong>Warning:
</strong>
158 This directive was deprecated in version
<xsl:value-of select=
"version" />.
159 <a href=
"#{use}">%
<xsl:value-of select=
"use" /></a> should be used instead.
162 <xsl:template match=
"usage/directive">
167 <xsl:apply-templates />
172 <xsl:template match=
"usage/directive/file">
174 <em><xsl:value-of select=
"@name" /></em> on line
<xsl:if test=
"count(line)>1">s
</xsl:if>
175 <xsl:text> </xsl:text>
176 <xsl:for-each select=
"line">
177 <xsl:if test=
"position()>1">,
</xsl:if>
178 <xsl:value-of select=
"." />
183 <xsl:template match=
"constraints/version">
185 <th>Version added
</th>
186 <td><xsl:value-of select=
"." /></td>
189 <xsl:template match=
"constraints/type">
193 <xsl:variable name=
"type" select=
"text()" />
194 <xsl:attribute name=
"class">type type-
<xsl:value-of select=
"$type" /></xsl:attribute>
195 <xsl:value-of select=
"$typeLookup/type[@id=$type]/text()" />
196 <xsl:if test=
"@allow-null='yes'">
202 <xsl:template match=
"constraints/allowed">
204 <th>Allowed values
</th>
206 <xsl:for-each select=
"value"><!--
207 --><xsl:if test=
"position()>1">,
</xsl:if>
208 "<xsl:value-of select=
"." />"<!--
213 <xsl:template match=
"constraints/default">
216 <td><pre><xsl:value-of select=
"." xml:
space=
"preserve" /></pre></td>
219 <xsl:template match=
"constraints/external">
221 <th>External deps
</th>
224 <xsl:apply-templates />
229 <xsl:template match=
"constraints/external/project">
230 <li><xsl:value-of select=
"." /></li>
235 <!-- vim: et sw=4 sts=4