Split up main stylesheet (necessary for new examples code)
authorJelmer Vernooij <jelmer@samba.org>
Sat, 11 Jun 2005 18:41:19 +0000 (18:41 +0000)
committerGerald W. Carter <jerry@samba.org>
Wed, 23 Apr 2008 13:46:45 +0000 (08:46 -0500)
(This used to be commit f74d0fc39ac4570d378ff797b260851fe9da34b6)

docs/xslt/expand-sambadoc.xsl
docs/xslt/expand-smbconfdoc.xsl [new file with mode: 0644]
docs/xslt/strip-references.xsl [new file with mode: 0644]

index cdc84e6d21330bb78b0b7536663d6f505535e2d5..87806a2aa2d7953ae88bb725c37e0712b174ffc8 100644 (file)
        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>
                </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 (file)
index 0000000..cd92990
--- /dev/null
@@ -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 (file)
index 0000000..568aeca
--- /dev/null
@@ -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>