]> pere.pagekite.me Git - text-epistlene.git/blob - Makefile
Get partintro adjustment working with current pandoc.
[text-epistlene.git] / Makefile
1 SOURCE = gaysir_epistlene
2
3 PANDOC_OPTS = \
4 -t docbook4 --top-level-division=part
5
6 DBLATEX_OPTS = \
7 -p pdf.xsl
8
9 all: $(SOURCE).pdf $(SOURCE).epub
10
11 $(SOURCE).xml: $(SOURCE)-body.xml Makefile book.xml bookinfo.xml
12 xmllint --nonet --xinclude --postvalid book.xml > $@.new && \
13 mv $@.new $@
14
15 $(SOURCE).pdf: $(SOURCE).xml Makefile pdf.xsl
16 dblatex $(DBLATEX_OPTS) $(SOURCE).xml -o $@
17
18 $(SOURCE)-body.xml: $(SOURCE).rst Makefile
19 pandoc -s -o $@ $(PANDOC_OPTS) $(SOURCE).rst
20 sed -i \
21 -e 's%article%book%g' \
22 -e 's%<title>[0-9]*</title>%<title></title>%g' \
23 -e 's%^ <blockquote>% <partintro><blockquote>%g' \
24 -e 's%^ </blockquote>% </blockquote></partintro>%g' \
25 -e 's%“%<quote>%g' \
26 -e 's%”%</quote>%g' $@
27
28 .xml.epub:
29 dbtoepub -s epub.xsl $^ -o $@
30
31 .xml.html:
32 xmlto html-nochunks $^
33
34 clean:
35 $(RM) *~
36
37 distclean: clean
38 $(RM) gaysir_epistlene.epub gaysir_epistlene.pdf
39 $(RM) gaysir_epistlene-body.xml
40
41 .SUFFIXES: .xml .html .pdf .epub