- Fix manpage index file (#2109)
authorJelmer Vernooij <jelmer@samba.org>
Tue, 7 Dec 2004 16:54:57 +0000 (16:54 +0000)
committerGerald W. Carter <jerry@samba.org>
Wed, 23 Apr 2008 13:59:21 +0000 (08:59 -0500)
- Fix plucker (Palm Documentation Format) output

docs/Makefile.in
docs/Samba-Developers-Guide/index.xml
docs/Samba-Guide/index.xml
docs/xslt/docbook2pearson.xsl

index dc3a8dd0da54eee4790921cd64d7ab5c98b29f52..f19fa05d810d11914d3e844295f4ec4515b75fbb 100644 (file)
@@ -54,7 +54,7 @@ MANPAGES = $(wildcard $(MANPAGEDIR)/*.?.xml)
 
 # 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 @@ $(DOCBOOKDIR)/%.xml: $(MANPAGEDIR)/%.xml xslt/expand-sambadoc.xsl
        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 @@ $(HTMLHELPDIR)/%: $(DOCBOOKDIR)/%.xml
        $(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)
 
index dfbe726a1314274ad6cca61fb88ce0833e922b69..82baa05cc5cb27efc80d74341059ea827bffb932 100644 (file)
@@ -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;
 ]>
 
index 5afff71f26df4d30fc0577acaf9d5ef5a40d2f28..132af17ce5e6452ea6dd6357d3496129f2a175c3 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>\r
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [\r
+<!DOCTYPE book PUBLIC "-//Samba//DTD Samba XML V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc" [\r
 \r
   <!-- entities files to use -->\r
   <!ENTITY % global_entities SYSTEM '../entities/global.entities'>\r
index d276d319915c5646925a463113f2ffadee2cb7e9..4a4158fa407d81ae10b161468b8bb062f19ed5af 100644 (file)
@@ -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>
                </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:apply-templates/>
-       </chapter>
-</xsl:template>
+       <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/>
-</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>
 
           <title><xsl:apply-templates/></title>
    </xsl:template>
 
+       <xsl:param name="notpchilds" select="'variablelist itemizedlist orderedlist'"/>
+
+       <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="para">
-          <p><xsl:apply-templates/></p>
-          <!-- p><xsl:apply-templates><value-of  
-                          select="normalize-space()"/></xsl:apply-templates></p -->
-   </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 match="tip">
-          <tip><xsl:apply-templates/></tip>
-   </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>
    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>