]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - Makefile
Move Docbook XML editing to new fixup-docbook.rb script.
[text-madewithcc.git] / Makefile
index 8327c897f88bd9882b30acb51680ecd990c0c258..fd91c4b8fa3efdefed68e4366fdb568cc9dcf571 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -74,9 +74,10 @@ $(SOURCE).nb.md: $(SOURCE).md po/nb/mwcc.po
        po4a-translate -f text -m $(SOURCE).md -p po/nb/mwcc.po -l $@ -l $@ -L utf-8 -M utf-8 -k 0
 
 %.xml: %.md
-       pandoc -s -o $@ $(PANDOC_OPTS) $^
-       perl -p -i -e 's/!DOCTYPE article/!DOCTYPE book/ ; \
-               s!<(/?)article(info|)?>!<$$1book$$2>!' $@
+       TEMP=`tempfile -p mwcc` && \
+         pandoc -s -o $$TEMP $(PANDOC_OPTS) $(SOURCE).md && \
+         ruby fixup-docbook.rb $$TEMP $@ && \
+         rm $$TEMP
 
 pdf: $(SOURCE).pdf
 %.pdf: %.tex