Add support for HTML version of smb.conf in chunks
authorJelmer Vernooij <jelmer@samba.org>
Fri, 7 Jan 2005 16:04:34 +0000 (16:04 +0000)
committerGerald W. Carter <jerry@samba.org>
Wed, 23 Apr 2008 13:59:24 +0000 (08:59 -0500)
docs/Makefile.in
docs/xslt/smb.conf-html.xsl [new file with mode: 0644]

index f19fa05d810d11914d3e844295f4ec4515b75fbb..4d84d1ca1008152114adcb62407360bbc078b6df 100644 (file)
@@ -229,6 +229,13 @@ $(MANDIR)/%: $(DOCBOOKDIR)/%.xml xslt/man.xsl
        mkdir -p $(@D)
        $(XSLTPROC) --output $@ xslt/man.xsl $<
 
+# Individual smb.conf parameters
+smb.conf-chunks: $(patsubst $(SMBDOTCONFDOC)/%.xml,$(HTMLDIR)/smb.conf/%.html,$(wildcard $(SMBDOTCONFDOC)/*/*.xml))
+       
+$(HTMLDIR)/smb.conf/%.html: $(SMBDOTCONFDOC)/%.xml
+       mkdir -p $(@D)
+       $(XSLTPROC) --output $@ xslt/smb.conf-html.xsl $<
+
 # Pearson compatible XML
 
 $(PEARSONDIR)/%.xml: %/index.xml xslt/pearson.xsl
diff --git a/docs/xslt/smb.conf-html.xsl b/docs/xslt/smb.conf-html.xsl
new file mode 100644 (file)
index 0000000..1458f63
--- /dev/null
@@ -0,0 +1,104 @@
+<?xml version='1.0'?>
+<!-- 
+       Samba-documentation specific stylesheets
+       Published under the GNU GPL
+
+       (C) Jelmer Vernooij                                     2005
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+       xmlns:exsl="http://exslt.org/common"
+       xmlns:samba="http://samba.org/common"
+       version="1.1"
+       extension-element-prefixes="exsl">
+
+       <xsl:import href="../settings.xsl"/>
+       <xsl:import href="html-common.xsl"/>
+
+       <xsl:output method="xml" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
+
+       <xsl:template match="samba:parameter">
+               <xsl:element name="html">
+                       <xsl:element name="head">
+                               <xsl:element name="link">
+                                       <xsl:attribute name="href"><xsl:text>smb.conf.xsl</xsl:text></xsl:attribute>
+                                       <xsl:attribute name="rel"><xsl:text>stylesheet</xsl:text></xsl:attribute>
+                                       <xsl:attribute name="type"><xsl:text>text/css</xsl:text></xsl:attribute>
+                               </xsl:element>
+
+                               <xsl:element name="title">
+                                       <xsl:value-of select="@name"/>
+                               </xsl:element>
+                       </xsl:element>
+                       <xsl:element name="body">
+                               <xsl:element name="h1">
+                                       <xsl:value-of select="@name"/>
+                               </xsl:element>
+
+                               <xsl:element name="div">
+                                       <xsl:attribute name="class"><xsl:text>context</xsl:text></xsl:attribute>
+                                       <xsl:text>Context: </xsl:text>
+                                       <xsl:choose>
+                                               <xsl:when test="@context = 'S'">
+                                                       <xsl:text>Share-specific</xsl:text>
+                                               </xsl:when>
+
+                                               <xsl:when test="@context = 'G'">
+                                                       <xsl:text>Global</xsl:text>
+                                               </xsl:when>
+
+                                               <xsl:otherwise>
+                                                       <xsl:message><xsl:text>Unknown value for context attribute : </xsl:text><xsl:value-of select="@context"/></xsl:message>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                               
+                               </xsl:element>
+
+                               <xsl:element name="div">
+                                       <xsl:attribute name="class"><xsl:text>type</xsl:text></xsl:attribute>
+                                       <xsl:text>Type: </xsl:text>
+                                       <xsl:value-of select="@type"/>
+                               </xsl:element>
+
+                               <xsl:element name="div">
+                                       <xsl:attribute name="class"><xsl:text>synonyms</xsl:text></xsl:attribute>
+                                       <xsl:text>Synonyms: </xsl:text>
+                                       <xsl:for-each select="synonym">
+                                               <xsl:text>, </xsl:text>
+                                               <xsl:value-of select="text()"/>
+                                       </xsl:for-each>
+                               </xsl:element>
+
+                               <xsl:for-each select="value">
+                                       <xsl:element name="div">
+                                               <xsl:attribute name="class"><xsl:text>value</xsl:text></xsl:attribute>
+                                               <xsl:choose>
+                                                       <xsl:when test="@type = 'default'">
+                                                               <xsl:text>Default value</xsl:text>
+                                                       </xsl:when>
+                                                       <xsl:when test="@type = 'example'">
+                                                               <xsl:text>Example value</xsl:text>
+                                                       </xsl:when>
+                                               </xsl:choose>
+
+                                               <xsl:text>: </xsl:text>
+                                       
+                                               <xsl:value-of select="text()"/>
+
+                                       </xsl:element>
+                               </xsl:for-each>
+
+                               <xsl:element name="div">
+                                       <xsl:attribute name="class"><xsl:text>description</xsl:text></xsl:attribute>
+
+                                       <xsl:for-each select="description">
+                                               <xsl:apply-templates/>
+                                       </xsl:for-each>
+                               </xsl:element>
+                       </xsl:element>
+               </xsl:element>
+       </xsl:template>
+
+       <xsl:template match="description">
+               <xsl:apply-templates/>
+       </xsl:template>
+</xsl:stylesheet>