]> pere.pagekite.me Git - text-free-culture-lessig.git/commitdiff
Make it easier to change PDF pipeline.
authorPetter Reinholdtsen <pere@hungry.com>
Fri, 10 Aug 2012 17:13:29 +0000 (19:13 +0200)
committerPetter Reinholdtsen <pere@hungry.com>
Fri, 10 Aug 2012 17:13:29 +0000 (19:13 +0200)
Makefile

index 1986fe08a584778f52b50897a405c5d0b4cd2e6f..3c38617db465ad56f6bc4afd9755027a060b2ce2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -53,24 +53,42 @@ epub: freeculture.nb.epub
 html: freeculture.html freeculture.nb.html 
 
 %.pdf: %.xml $(IMAGES) $(PDF_XSLT)
-#      $(DBLATEX) $<
-
-# Alternative processing path to dblatex is to use xmlto using fop to
-# create PDF like this.  The PDF output (visual design) is better, but
-# the footnote handling is worse and images are missing.
-#      xmlto --noautosize \
-#      -x data/stylesheet-fo.xsl \
-#        --with-fop pdf $<
-
-# Third alternative is to use xsltproc and fop directly, as
-# recommended by <URL: http://www.sagehill.net/docbookxsl/index.html > .
-# This include images, but the index refs and footnote handling is
-# broken.
-       xsltproc  \
-         --output $(subst .pdf,.fo,$@) \
-         data/stylesheet-fo.xsl \
-         $<
-       fop -c data/fop-params.xconf -fo $(subst .pdf,.fo,$@) -pdf $@
+# Possible pipelines:
+#
+# dblatex:
+#   This converts the docbook content to latex and leave it to latex
+#   to format it.
+#
+# xmlto:
+#   Alternative processing path to dblatex is to use xmlto using fop
+#   to create PDF like this.  The PDF output (visual design) is
+#   better, but the footnote handling is worse and images are missing.
+#
+# docbook-xsl:
+#   Third alternative is to use xsltproc and fop directly, as
+#   recommended by <URL: http://www.sagehill.net/docbookxsl/index.html >.
+#   This include images, but the index refs and footnote handling
+#   is broken.
+
+       pipeline=dblatex; \
+       echo "Using $$pipeline pipeline" ; \
+       case "$$pipeline" in  \
+       dblatex) \
+         $(DBLATEX) $< ; \
+         ;; \
+       xmlto) \
+         xmlto --noautosize \
+           -x data/stylesheet-fo.xsl \
+           --with-fop pdf $< ; \
+         ;; \
+       docbook-xsl) \
+         xsltproc  \
+           --output $(subst .pdf,.fo,$@) \
+           data/stylesheet-fo.xsl \
+           $< ; \
+         fop -c data/fop-params.xconf -fo $(subst .pdf,.fo,$@) -pdf $@ ; \
+         ;; \
+       esac
 
 pdf-compare: freeculture.xml $(IMAGES)
        dblatex -o freeculture-dblatex.pdf freeculture.xml