]> granicus.if.org Git - docbook-dsssl/commitdiff
Build tools
authorNorman Walsh <ndw@nwalsh.com>
Thu, 10 Jan 2002 22:46:58 +0000 (22:46 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 10 Jan 2002 22:46:58 +0000 (22:46 +0000)
testdocs/i18n/.cvsignore [new file with mode: 0644]
testdocs/i18n/Makefile [new file with mode: 0644]
testdocs/i18n/i18n-fo.xsl [new file with mode: 0644]

diff --git a/testdocs/i18n/.cvsignore b/testdocs/i18n/.cvsignore
new file mode 100644 (file)
index 0000000..40c19e8
--- /dev/null
@@ -0,0 +1,2 @@
+*.pdf
+titlepage-fo.xsl
diff --git a/testdocs/i18n/Makefile b/testdocs/i18n/Makefile
new file mode 100644 (file)
index 0000000..60787c5
--- /dev/null
@@ -0,0 +1,84 @@
+include ../../cvstools/Makefile.incl
+
+XSLT=$(CVSTOOLSROOT)/xslt --processor=xsltproc
+
+XSLHTML=../xsl/html/docbook.xsl
+XSLFO=i18n-fo.xsl
+XSLCHUNK=../xsl/html/chunk.xsl
+
+STYLEOPT=
+
+FORMATTER=xep
+
+RESULT=html
+
+ifeq ($(RESULT),html)
+   STYLE=$(XSLHTML)
+   USETIDY=1
+else
+   STYLE=$(XSLFO)
+   USETIDY=0
+endif
+
+all: i18n.pdf i18n.html index.html
+
+index.html:
+       $(XJPARSE) $<
+       $(XSLT) $< $(XSLCHUNK) $@ $(STYLEOPT)
+ifeq ($(USETIDY),1)
+       $(TIDY) -iq -latin1 -mn *.html
+endif
+
+%.html : %.xml
+       $(XJPARSE) $<
+       $(XSLT)  $< $(XSLHTML) $@ $(STYLEOPT)
+ifeq ($(USETIDY),1)
+       $(TIDY) -iq -latin1 -mn $@
+endif
+
+%.fo : %.xml $(XSLFO) titlepage-fo.xsl
+ifeq ($(FORMATTER),tex)
+       $(XSLT) $< $(XSLFO) $@ passivetex.extensions=1 $(STYLEOPT)
+else
+ifeq ($(FORMATTER),fop)
+       $(XSLT) $< $(XSLFO) $@ fop.extensions=1 $(STYLEOPT)
+else
+ifeq ($(FORMATTER),xep)
+       $(XSLT) $< $(XSLFO) $@ xep.extensions=1 $(STYLEOPT)
+else
+       $(XSLT) $< $(XSLFO) $@ $(STYLEOPT)
+endif
+endif
+endif
+
+%.pdf : %.fo
+ifeq ($(FORMATTER),tex)
+       pdftex "&pdfxmltex" $<
+       @if [ `grep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \
+               pdftex "&pdfxmltex" $< ; \
+       fi
+       @if [ `grep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \
+               pdftex "&pdfxmltex" $< ; \
+       fi
+else
+ifeq ($(FORMATTER),fop)
+       fop $< $@
+else
+ifeq ($(FORMATTER),xep)
+       xep $<
+else
+       echo How would you like me to make the PDF file?
+endif
+endif
+endif
+
+titlepage-fo.xsl: titlepage-fo.xml
+       $(XSLT) $< ../../xsl/template/titlepage.xsl $@
+
+clean:
+       rm -f *.html *.htm *.fo *.pdf *.ps *.rtf
+       rm -f *.log *.aux *.out *.tex *.dvi
+       rm -f mlang.xml mlang.sgm
+       rm -f toc.hhc htmlhelp.hhp htmlhelp.chm Index.hhk
+       rm -f HTML.index
+       rm -f jhelpidx.xml jhelpmap.jhm jhelpset.hs jhelptoc.xml
diff --git a/testdocs/i18n/i18n-fo.xsl b/testdocs/i18n/i18n-fo.xsl
new file mode 100644 (file)
index 0000000..20f01a9
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
+<xsl:include href="titlepage-fo.xsl"/>
+
+<!-- ====================================================================== -->
+
+<xsl:param name="title.margin.left" select="'0pt'"/>
+<xsl:param name="ulink.show" select="0"/>
+
+<!-- ====================================================================== -->
+
+<xsl:template match="othercredit" mode="titlepage.mode">
+  <xsl:variable name="contrib" select="string(contrib)"/>
+  <xsl:choose>
+    <xsl:when test="contrib">
+      <xsl:if test="not(preceding-sibling::othercredit[string(contrib)=$contrib])">
+        <fo:block>
+          <xsl:apply-templates mode="titlepage.mode" select="contrib"/>
+          <xsl:text>: </xsl:text>
+          <xsl:call-template name="person.name"/>
+          <xsl:if test="affiliation/address/email">
+            <xsl:text>, </xsl:text>
+            <xsl:apply-templates select="affiliation/address/email"
+                                 mode="titlepage.mode"/>
+          </xsl:if>
+          <xsl:apply-templates select="following-sibling::othercredit[string(contrib)=$contrib]" mode="titlepage.othercredits"/>
+        </fo:block>
+      </xsl:if>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block><xsl:call-template name="person.name"/></fo:block>
+      <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="titlepage.othercredits">
+  <xsl:text>; </xsl:text>
+  <xsl:call-template name="person.name"/>
+  <xsl:if test="affiliation/address/email">
+    <xsl:text>, </xsl:text>
+    <xsl:apply-templates select="affiliation/address/email"
+                         mode="titlepage.mode"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+</xsl:stylesheet>