]> pere.pagekite.me Git - text-destroy-surveillance.git/commitdiff
Add HTML and EPUB build rules.
authorPetter Reinholdtsen <pere@hungry.com>
Thu, 24 Sep 2020 10:18:18 +0000 (12:18 +0200)
committerPetter Reinholdtsen <pere@hungry.com>
Thu, 24 Sep 2020 10:18:18 +0000 (12:18 +0200)
Makefile
epub.xsl [new file with mode: 0644]

index a1c479c09eda1ca2905628dcd15e9ca947560b53..c0092e3ce24d3db3abc67385123fc06372e99615 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 SOURCE=how-to-destroy-surveillance-capitalism
 GENERATED = $(SOURCE).xml $(SOURCE).pdf \
-       $(SOURCE).nb.xml $(SOURCE).nb.pdf
+       $(SOURCE).nb.xml $(SOURCE).nb.pdf $(SOURCE).nb.html $(SOURCE).nb.epub
 
 PANDOC_OPTS = \
   -t docbook4
@@ -39,6 +39,12 @@ $(SOURCE).nb.xml: po/$(SOURCE).nb.po complete-book.xml
 $(SOURCE).nb.pdf: $(SOURCE).nb.xml Makefile pdf.xsl
        dblatex $(DBLATEX_OPTS) $(SOURCE).nb.xml -o $@
 
+.xml.epub:
+       dbtoepub -s epub.xsl $^ -o $@
+
+.xml.html:
+       xmlto -m pdf.xsl html-nochunks $^
+
 XMLLINTOPTS = --nonet --noout  --xinclude --postvalid 
 lint: book.xml
        xmllint $(XMLLINTOPTS) $^
@@ -50,3 +56,5 @@ distclean: clean
 
 stats:
        for f in po/*.po; do printf "$$f "; msgfmt --output /dev/null --statistics $$f; done
+
+.SUFFIXES: .xml .html .pdf .epub
diff --git a/epub.xsl b/epub.xsl
new file mode 100644 (file)
index 0000000..2e00256
--- /dev/null
+++ b/epub.xsl
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+  <xsl:import href="/usr/share/xml/docbook/stylesheet/docbook-xsl/epub/docbook.xsl" />
+  <xsl:import href="pdf.xsl" />
+</xsl:stylesheet>