summaryrefslogtreecommitdiff
path: root/docs/xslt/expand-smbconfdoc.xsl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-06-11 18:41:19 +0000
committerGerald W. Carter <jerry@samba.org>2008-04-23 08:46:45 -0500
commit313a0c688d0fbca77c2a3605f973409b295bbca9 (patch)
treeb7dfc921d9a0b6a6de81ca23b7962b200d176873 /docs/xslt/expand-smbconfdoc.xsl
parente8fda7aac83d924918c1d7c6ff75bbd001b26987 (diff)
downloadsamba-313a0c688d0fbca77c2a3605f973409b295bbca9.tar.gz
samba-313a0c688d0fbca77c2a3605f973409b295bbca9.tar.bz2
samba-313a0c688d0fbca77c2a3605f973409b295bbca9.zip
Split up main stylesheet (necessary for new examples code)
(This used to be commit f74d0fc39ac4570d378ff797b260851fe9da34b6)
Diffstat (limited to 'docs/xslt/expand-smbconfdoc.xsl')
-rw-r--r--docs/xslt/expand-smbconfdoc.xsl171
1 files changed, 171 insertions, 0 deletions
diff --git a/docs/xslt/expand-smbconfdoc.xsl b/docs/xslt/expand-smbconfdoc.xsl
new file mode 100644
index 0000000000..cd92990234
--- /dev/null
+++ b/docs/xslt/expand-smbconfdoc.xsl
@@ -0,0 +1,171 @@
+<?xml version='1.0'?>
+<!--
+ smb.conf-documentation specific stylesheets
+ Published under the GNU GPL
+
+ (C) Jelmer Vernooij 2002-2004
+ (C) Alexander Bokovoy 2002-2004
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"
+ version="1.1">
+
+ <xsl:template match="description"><xsl:apply-templates/></xsl:template>
+
+ <xsl:template match="value"><xsl:apply-templates/></xsl:template>
+
+ <xsl:template match="synonym"><xsl:apply-templates/></xsl:template>
+
+ <xsl:template match="related"><xsl:apply-templates/></xsl:template>
+
+ <xsl:template match="//samba:parameterlist">
+ <xsl:apply-templates>
+ <xsl:sort select="varlistentry/term/anchor"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="value/comment">
+ <xsl:text>&#10;# </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="//samba:parameter">
+ <!-- reconstruct varlistentry - not all of them will go into separate files
+ and also we must repair the main varlistentry itself.
+ -->
+ <xsl:variable name="cname"><xsl:value-of select="translate(translate(string(@name),' ',''),
+ 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+ </xsl:variable>
+
+ <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
+
+ <xsl:variable name="anchor">
+ <xsl:element name="anchor">
+ <xsl:attribute name="id">
+ <xsl:value-of select="$cname"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:variable>
+
+ <xsl:variable name="context">
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="@context"/>
+ <xsl:text>)</xsl:text>
+ </xsl:variable>
+
+ <xsl:variable name="term">
+ <xsl:element name="term">
+ <xsl:copy-of select="$anchor"/>
+ <xsl:value-of select="@name"/>
+ <xsl:value-of select="$context"/>
+ </xsl:element>
+ </xsl:variable>
+
+
+ <!-- Generate list of examples -->
+ <xsl:variable name="examples">
+ <xsl:for-each select="value">
+ <xsl:if test="@type = 'example'">
+ <xsl:element name="para">
+ <xsl:text>Example: </xsl:text>
+ <xsl:element name="emphasis">
+ <xsl:element name="parameter">
+ <xsl:copy-of select="$name"/>
+ </xsl:element>
+ <xsl:text> = </xsl:text>
+ <xsl:apply-templates select="."/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:element>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:variable name="tdefault">
+ <xsl:for-each select="value">
+ <xsl:if test="@type = 'default'">
+ <xsl:element name="para">
+ <xsl:text>Default: </xsl:text>
+ <xsl:element name="emphasis">
+ <xsl:element name="parameter">
+ <xsl:copy-of select="$name"/>
+ </xsl:element>
+ <xsl:text> = </xsl:text>
+ <xsl:apply-templates select="."/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:element>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:variable name="default">
+ <xsl:choose>
+ <xsl:when test="$tdefault = ''">
+ <xsl:element name="para">
+ <xsl:element name="emphasis">
+ <xsl:text>No default</xsl:text>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$tdefault"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="content">
+ <xsl:apply-templates select="description"/>
+ </xsl:variable>
+
+ <xsl:for-each select="synonym">
+ <xsl:element name="varlistentry">
+ <xsl:text>&#10;</xsl:text>
+ <xsl:element name="indexterm">
+ <xsl:attribute name="significance">
+ <xsl:text>preferred</xsl:text>
+ </xsl:attribute>
+ <xsl:element name="primary">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ <xsl:element name="see">
+ <xsl:value-of select="$name"/>
+ </xsl:element>
+ </xsl:element>
+
+ <xsl:element name="term">
+ <xsl:element name="anchor">
+ <xsl:attribute name="id">
+ <xsl:value-of select="translate(translate(string(.),' ',''), 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+ </xsl:attribute>
+ </xsl:element>
+ <xsl:value-of select="."/>
+ </xsl:element>
+
+ <xsl:element name="listitem">
+ <xsl:element name="para"><xsl:text>This parameter is a synonym for </xsl:text><xsl:copy-of select="$name"/><xsl:text>.</xsl:text></xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+
+ <xsl:element name="varlistentry">
+ <xsl:text>&#10;</xsl:text>
+ <xsl:element name="indexterm">
+ <xsl:attribute name="significance">
+ <xsl:text>preferred</xsl:text>
+ </xsl:attribute>
+ <xsl:element name="primary">
+ <xsl:value-of select="@name"/>
+ </xsl:element>
+ </xsl:element>
+ <xsl:copy-of select="$term"/>
+ <xsl:element name="listitem">
+ <xsl:copy-of select="$content"/> <xsl:text>&#10;</xsl:text>
+ <xsl:copy-of select="$default"/> <xsl:text>&#10;</xsl:text>
+ <xsl:copy-of select="$examples"/> <xsl:text>&#10;</xsl:text>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>