summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2013-02-17 21:02:52 +0000
committerbrian m. carlson <sandals@crustytoothpaste.net>2013-02-17 21:02:52 +0000
commit385a02e66c4c29ccde702d3897083c4399602a75 (patch)
tree913b382d4c269bf706ec01ba65cad216ed8ed4cb
parent48ebb498cdfd099922e318e9093d32a0789f838f (diff)
Add support for building .html files.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
-rw-r--r--.gitignore1
-rw-r--r--Makefile14
2 files changed, 14 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 7f9a3d0..1e24596 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
*.txml
*.epub
*.d
+*.html
diff --git a/Makefile b/Makefile
index 3bbc923..02ebb29 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,14 @@ DOC_CVT := $(HOME)/.crustytoothpaste/groups/scripts/doc-convert
FO_STYLE := report
EPUB_STYLE := base
+HTML_STYLE := base
PROFILE := /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/profiling/profile.xsl
STYLE := $(SHEETDIR)/fo/style/$(FO_STYLE)/cvt.xsl
PSTP := $(SHEETDIR)/fo/style/$(FO_STYLE)/pstp.xsl
EPUBSTYLE := $(SHEETDIR)/epub/style/$(EPUB_STYLE)/cvt.xsl
+HTMLSTYLE := $(SHEETDIR)/xhtml5/style/$(HTML_STYLE)/cvt.xsl
+HTMLPSTP := $(SHEETDIR)/xhtml5/style/$(HTML_STYLE)/pstp.xsl
TSTROFF := tenorsax-troff
DBTOEPUB := dbtoepub
@@ -20,7 +23,7 @@ STYLEARGS += --stringparam generate.toc "/ nop article nop book nop"
CUR = $<
SRC_SUFFIXES := .dbx .mx
-GEN_SUFFIXES := .pdf .fo .rtf .txml .epub
+GEN_SUFFIXES := .pdf .fo .rtf .txml .epub .html
DEPFILES := $(patsubst %.dbx,.%.d,$(wildcard *.dbx))
ALLSRCS := $(shell for i in $(SRC_SUFFIXES); do find -name "*$$i" | grep -v rsrc; done)
@@ -68,6 +71,15 @@ depend: $(DEPFILES)
xsltproc --xinclude $(PROFARGS) $(PROFILE) $(CUR); \
fi) > $@.tmp; $(DBTOEPUB) -o $@ -s $(EPUBSTYLE) $@.tmp; rm $@.tmp
+.dbx.html .txml.html:
+ (str="$(CUR)"; if [ -z "$${str##*/*}" ]; \
+ then \
+ cat $(CUR); \
+ else \
+ xsltproc --xinclude $(PROFARGS) $(PROFILE) $(CUR); \
+ fi) | xsltproc --xinclude $(STYLEARGS) $(HTMLSTYLE) - | \
+ xsltproc -o $@ $(HTMLPSTP) -
+
clean:
for i in $(GEN_SUFFIXES); do find -name "*$$i" | xargs rm -f; done
find -name '*.d' | xargs -r rm