svn commit: samba-docs r301 - in trunk: . Samba-Developers-Guide Samba-Guide xslt

jelmer at samba.org jelmer at samba.org
Tue Dec 7 16:54:57 GMT 2004


Author: jelmer
Date: 2004-12-07 16:54:57 +0000 (Tue, 07 Dec 2004)
New Revision: 301

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-docs&rev=301

Log:
- Fix manpage index file (#2109)
- Fix plucker (Palm Documentation Format) output

Modified:
   trunk/Makefile.in
   trunk/Samba-Developers-Guide/index.xml
   trunk/Samba-Guide/index.xml
   trunk/xslt/docbook2pearson.xsl


Changeset:
Modified: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	2004-12-07 16:39:35 UTC (rev 300)
+++ trunk/Makefile.in	2004-12-07 16:54:57 UTC (rev 301)
@@ -54,7 +54,7 @@
 
 # Lists of files to process
 LATEX_FIGURES = xslt/figures/caution.pdf xslt/figures/important.pdf xslt/figures/note.pdf xslt/figures/tip.pdf xslt/figures/warning.pdf
-MANPAGES_PLUCKER = $(patsubst $(MANPAGEDIR)/%.xml,$(PLUCKERDIR)/%.pdb,$(MANPAGES_SOURCES))
+MANPAGES_PLUCKER = $(patsubst $(MANPAGEDIR)/%.xml,$(PLUCKERDIR)/%.pdb,$(MANPAGES))
 
 help: 
 	@echo "Supported make targets:"
@@ -104,10 +104,10 @@
 	mkdir -p $(@D)
 	$(XSLTPROC) --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ xslt/expand-sambadoc.xsl $<
 
-$(DOCBOOKDIR)/manpages.xml: $(MANPAGES_SOURCES) xslt/manpage-summary.xsl
+$(DOCBOOKDIR)/manpages.xml: $(MANPAGES) xslt/manpage-summary.xsl
 	mkdir -p $(@D)
 	echo "<article><variablelist>" > $@
-	for I in $(MANPAGES_SOURCES); do $(XSLTPROC) xslt/manpage-summary.xsl $$I >> $@; done
+	for I in $(MANPAGES); do $(XSLTPROC) xslt/manpage-summary.xsl $$I >> $@; done
 	echo "</variablelist></article>" >> $@
 
 # HTML docs
@@ -209,7 +209,7 @@
 	$(XSLTPROC) --stringparam htmlhelp.chm $*.chm --stringparam manifest.in.base.dir "$@/" --stringparam base.dir "$@/" http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl $<
 
 # Plucker docs
-$(PLUCKERDIR)/%.pdb: $(HTMLDIR)/%.html $(PLUCKERDIR)
+$(PLUCKERDIR)/%.pdb: $(HTMLDIR)/%.html 
 	mkdir -p $(@D)
 	$(PLUCKERBUILD) -v -M1 --stayonhost  --noimages --zlib-compression -H file:$< -f $* -p $(PLUCKERDIR)
 

Modified: trunk/Samba-Developers-Guide/index.xml
===================================================================
--- trunk/Samba-Developers-Guide/index.xml	2004-12-07 16:39:35 UTC (rev 300)
+++ trunk/Samba-Developers-Guide/index.xml	2004-12-07 16:54:57 UTC (rev 301)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+<!DOCTYPE book PUBLIC "-//samba//DTD Samba XML V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc" [
 <!ENTITY % globalentities SYSTEM '../entities/global.entities'> %globalentities;
 ]>
 

Modified: trunk/Samba-Guide/index.xml
===================================================================
--- trunk/Samba-Guide/index.xml	2004-12-07 16:39:35 UTC (rev 300)
+++ trunk/Samba-Guide/index.xml	2004-12-07 16:54:57 UTC (rev 301)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+<!DOCTYPE book PUBLIC "-//Samba//DTD Samba XML V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc" [
 
   <!-- entities files to use -->
   <!ENTITY % global_entities SYSTEM '../entities/global.entities'>

Modified: trunk/xslt/docbook2pearson.xsl
===================================================================
--- trunk/xslt/docbook2pearson.xsl	2004-12-07 16:39:35 UTC (rev 300)
+++ trunk/xslt/docbook2pearson.xsl	2004-12-07 16:54:57 UTC (rev 301)
@@ -53,7 +53,7 @@
 		</xsl:if>
 	</xsl:template>
 
-	<xsl:template match="/">
+	<xsl:template match="/" mode="default">
 		<xsl:processing-instruction  
 			name="xml-stylesheet">href="pearson.css"  
 			type="text/css"</xsl:processing-instruction>
@@ -85,24 +85,30 @@
 		</bookinfo>
 	</xsl:template>
 
-	<xsl:template match="bookinfo/author">
-		<!-- author>
-		<xsl:apply-templates/>
-	</author -->
-</xsl:template>
+	<xsl:template match="author">
+		<author>
+			<xsl:apply-templates/>
+		</author>
+	</xsl:template>
 
-<xsl:template match="chapter">
-	<chapter>
-		<xsl:call-template name="transform.id.attribute"/>
+	<xsl:template match="editor">
+		<editor>
+			<xsl:apply-templates/>
+		</editor>
+	</xsl:template>
+
+	<xsl:template match="chapter">
+		<chapter>
+			<xsl:call-template name="transform.id.attribute"/>
+			<xsl:apply-templates/>
+		</chapter>
+	</xsl:template>
+
+	<xsl:template match="chapter/title/command">
 		<xsl:apply-templates/>
-	</chapter>
-</xsl:template>
+	</xsl:template>
 
-<xsl:template match="chapter/title/command">
-	<xsl:apply-templates/>
-</xsl:template>
-
-   <xsl:template match="index">
+	<xsl:template match="index">
        <xsl:comment> XXX insert index here </xsl:comment>
    </xsl:template>
 
@@ -154,17 +160,55 @@
 	   <title><xsl:apply-templates/></title>
    </xsl:template>
 
+	<xsl:param name="notpchilds" select="'variablelist itemizedlist orderedlist'"/>
 
-   <xsl:template match="para">
-	   <p><xsl:apply-templates/></p>
-	   <!-- p><xsl:apply-templates><value-of  
-			   select="normalize-space()"/></xsl:apply-templates></p -->
-   </xsl:template>
+	<xsl:template match="para"> 
+		<!-- loop thru all elements: -->
+		<xsl:for-each select="*|text()">
+			<xsl:choose>
+				<xsl:when test="string-length(name(.)) > 0 and contains($notpchilds,name(.))">
+					<xsl:message><xsl:text>Removing from p:</xsl:text><xsl:value-of select="name(.)"/></xsl:message>
+					<xsl:apply-templates select="."/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="hstartpara"/>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
 
-   <xsl:template match="tip">
-	   <tip><xsl:apply-templates/></tip>
-   </xsl:template>
+	<!-- Do open paragraph when previous sibling was not a valid p child -->
+	<xsl:template name="hstartpara">
+		<xsl:if test="not(preceding-sibling::*[1]) or (contains($notpchilds,name(preceding-sibling::*[1])) and not(string-length(name(.)) > 0))">
+			<p>
+				<xsl:apply-templates select="."/>
+				<xsl:for-each select="following-sibling::*[not(contains($notpchilds,name(.)) and string-length(name(.)) > 0)]">
+					<xsl:apply-templates select="."/>
+				</xsl:for-each>
+			</p>
+		</xsl:if>
+	</xsl:template>
 
+	<xsl:template name="hsubpara">
+		<xsl:param name="data"/>
+		<xsl:apply-templates select="$data"/>
+		<xsl:if test="$data[following-sibling::*[1]]">
+			<xsl:param name="next" select="$data[following-sibling::*[1]]"/>
+			<xsl:message><xsl:value-of select="name(.)"/></xsl:message>
+			<xsl:if test="$next and (not(contains($notpchilds,name($next))) or $next[text()])">
+				<xsl:message><xsl:text>Followed by : </xsl:text><xsl:value-of select="name($next)"/></xsl:message>
+				<xsl:call-template name="hsubpara">
+					<xsl:with-param name="data" select="$next"/>
+				</xsl:call-template>
+				<xsl:message><xsl:text>Done Followed by : </xsl:text><xsl:value-of select="name($next)"/></xsl:message>
+			</xsl:if>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="tip">
+		<tip><xsl:apply-templates/></tip>
+	</xsl:template>
+
    <xsl:template match="warning|important|caution">
 	   <stop><xsl:apply-templates/></stop>
    </xsl:template>
@@ -819,18 +863,8 @@
    match="quote"><quote><xsl:apply-templates/></quote></xsl:template -->
 
 
-   <!-- Literaturverzeichnis -->
-   <xsl:template match="author">
-	   <xsl:apply-templates/>,
-   </xsl:template>
-
-   <xsl:template match="editor">
-	   <!--FIXME: More information referring to editor ? -->
-	   <xsl:apply-templates/>,
-   </xsl:template>
-
    <xsl:template match="othername">
-	   <xsl:apply-templates/>
+	   <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>0
    </xsl:template>
    <xsl:template match="firstname">
 	   <xsl:apply-templates/><xsl:text> </xsl:text>



More information about the samba-cvs mailing list