summaryrefslogtreecommitdiff
path: root/docs/xslt
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
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')
-rw-r--r--docs/xslt/expand-sambadoc.xsl199
-rw-r--r--docs/xslt/expand-smbconfdoc.xsl171
-rw-r--r--docs/xslt/strip-references.xsl42
3 files changed, 215 insertions, 197 deletions
diff --git a/docs/xslt/expand-sambadoc.xsl b/docs/xslt/expand-sambadoc.xsl
index cdc84e6d21..87806a2aa2 100644
--- a/docs/xslt/expand-sambadoc.xsl
+++ b/docs/xslt/expand-sambadoc.xsl
@@ -11,48 +11,11 @@
version="1.1">
<xsl:import href="../settings.xsl"/>
+ <xsl:import href="strip-references.xsl"/>
+ <xsl:import href="expand-smbconfdoc.xsl"/>
<xsl:output method="xml" encoding="UTF-8" doctype-public="-//OASIS//DTD DocBook XML V4.2//EN" indent="yes" doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/>
- <xsl:template match="reference/refentry/refsect1">
- <xsl:if test="title!='VERSION' and title!='AUTHOR'">
- <xsl:element name="refsect1">
- <xsl:if test="@id!=''">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="reference/refentry">
- <xsl:element name="section">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:element name="title">
- <xsl:value-of select="refmeta/refentrytitle"/>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="reference/refentry/refmeta"/>
-
- <xsl:template match="reference/refentry/refnamediv"/>
-
- <xsl:template match="reference">
- <xsl:element name="appendix">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
-
<!-- This is needed to copy content unchanged -->
<xsl:template match="@*|node()">
<xsl:copy>
@@ -286,162 +249,4 @@
</xsl:element>
</xsl:template>
- <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>
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>
diff --git a/docs/xslt/strip-references.xsl b/docs/xslt/strip-references.xsl
new file mode 100644
index 0000000000..568aecafd2
--- /dev/null
+++ b/docs/xslt/strip-references.xsl
@@ -0,0 +1,42 @@
+<?xml version='1.0'?>
+<!-- Removes particular (unuseful for the book) elements from references -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.1">
+ <xsl:template match="reference/refentry/refsect1">
+ <xsl:if test="title!='VERSION' and title!='AUTHOR'">
+ <xsl:element name="refsect1">
+ <xsl:if test="@id!=''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="reference/refentry">
+ <xsl:element name="section">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:element name="title">
+ <xsl:value-of select="refmeta/refentrytitle"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="reference/refentry/refmeta"/>
+
+ <xsl:template match="reference/refentry/refnamediv"/>
+
+ <xsl:template match="reference">
+ <xsl:element name="appendix">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>