]> granicus.if.org Git - docbook-dsssl/commitdiff
Changed build to generate a "html-synop.xsl" file and to have it
authorMichael Smith <xmldoc@users.sourceforge.net>
Wed, 9 Nov 2005 11:49:28 +0000 (11:49 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Wed, 9 Nov 2005 11:49:28 +0000 (11:49 +0000)
imported into the driver stylesheet. The build now uses the newly
added html2roff.xsl stylesheet to transform the ../xhtml/synop.xsl
file to generate the html-synop.xsl file. The only transformation
it currently does is to transform <br/> instances into line breaks
and to transform <pre></pre> instances into roff "no fill region"
markup.

This change is a cheap way to enable the manpages stylesheet to
correctly handle OO synopsis content, which it did not handle
correctly previously.

xsl/manpages/.cvsignore
xsl/manpages/Makefile
xsl/manpages/docbook.xsl
xsl/manpages/html2roff.xsl [new file with mode: 0644]

index bf7e41f8e05ca0733e9775ed2105d52c6890b81c..6aec73cae80e6422054f682811dfb79ed7a6deae 100644 (file)
@@ -3,3 +3,4 @@ param.xml
 param.xsl
 profile-docbook.xsl
 xref.xsl
+html-synop.xsl
index c1817512e4fd50ba82d32765de3139bfe4df683e..2c1725d3bf563d7cdc7ca86df787d4e04ffb98d3 100644 (file)
@@ -2,10 +2,11 @@ include ../../cvstools/Makefile.incl
 
 PARAMPROF=.param.profiled
 PARAMSTRIP=.param.stripped
+MAKE_SYNOP=html2roff.xsl
 
 include Makefile.param
 
-all: param.xsl
+all: param.xsl html-synop.xsl
 
 xml: param.xml
 
@@ -32,7 +33,11 @@ Makefile.param:
        ../../cvstools/paramchk -m $@ param.xweb
        make
 
+html-synop.xsl: ../xhtml/synop.xsl
+       $(XSLT) $< $(MAKE_SYNOP) $@
+
 clean:
        $(RM) param.xml param.html param.xsl
+       $(RM) html-synop.xsl
        $(RM) Makefile.param
        echo "# foo" > Makefile.param
index 6524db28b5549fac5b583b36a096d6985a249d95..ba5f4731e445ad34e77992fd356434eafa00e0ab 100644 (file)
@@ -4,8 +4,9 @@
                 exclude-result-prefixes="exsl"
                 version='1.0'>
 
-  <xsl:import href="../html/docbook.xsl"/>
-  <xsl:import href="../html/manifest.xsl"/>
+  <xsl:import href="../xhtml/docbook.xsl"/>
+  <xsl:import href="../xhtml/manifest.xsl"/>
+  <xsl:import href="html-synop.xsl"/> <!-- generated by build -->
 
   <xsl:output method="text"
               encoding="UTF-8"
diff --git a/xsl/manpages/html2roff.xsl b/xsl/manpages/html2roff.xsl
new file mode 100644 (file)
index 0000000..ab24d2d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:ng="http://docbook.org/docbook-ng"
+                xmlns:db="http://docbook.org/ns/docbook"
+                xmlns:exsl="http://exslt.org/common"
+                exclude-result-prefixes="exsl db ng"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- * Standalone stylesheet for doing "HTML to roff" transformation of a -->
+<!-- * stylesheet; which currently just means that it transforms all -->
+<!-- * <br/> instances into a line break, and all <pre></pre> instances -->
+<!-- * into roff "no fill region" markup -->
+
+<!-- ==================================================================== -->
+
+  <xsl:output method="xml"
+              encoding="UTF-8"
+              indent="no"/>
+
+  <xsl:template match="node() | @*">
+    <xsl:copy>
+      <xsl:apply-templates select="@* | node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <!-- ==================================================================== -->
+
+  <xsl:template match="br">
+    <xsl:element name="xsl:text">&#10;</xsl:element>
+  </xsl:template>
+
+  <xsl:template match="pre">
+    <xsl:element name="xsl:text">.nf&#10;</xsl:element>
+    <xsl:copy>
+      <xsl:apply-templates select="@* | node()"/>
+    </xsl:copy>
+    <xsl:element name="xsl:text">&#10;.fi&#10;</xsl:element>
+  </xsl:template>
+
+</xsl:stylesheet>