+#
+# As of October 2017, I'm doing some Spanish-specific adjustments to
+# this Makefile; they should be generalized... But I'm taking a step at a time :)
+# -GW
+#
SOURCE=MadewithCreativeCommonsmostup-to-dateversion
# Versioning: I'm using the date on which I got the source document
# increase every time the generated Markdown is modified.
VERSION=20170609-2
+PANDOC_OPTS = --top-level-division=part -t docbook -f markdown+inline_notes --variable 'author:Paul Stacey' --variable 'author:Sarah Hinchliff Pearson' --variable 'title:Hecho con Creative Commons'
# --top-level-diversion is not available in pandoc in Jessie
-PANDOCOPTS = --top-level-division=part -t docbook -f markdown+inline_notes
-PANDOCOPTS = -t docbook -f markdown+inline_notes
+# PANDOC_OPTS = -t docbook -f markdown+inline_notes
LANGS = es nl nb
po4a-translate -f text -m $(SOURCE).md -p po/es/mwcc.po -l $@ -l $@ -L utf8 -M utf8 -k 20
%.xml: %.md
- pandoc -s -o $@ $(PANDOCOPTS) $^
+ pandoc -s -o $@ $(PANDOC_OPTS) $^
+ perl -p -i -e 's/!DOCTYPE article/!DOCTYPE book/' $@
+ perl -p -i -e 's!<(/?)article(info|)?>!<$$1book$$2>!' $@
pdf: $(SOURCE).pdf
-%.pdf: %.xml
- dblatex -b xetex $^
+%.pdf: %.tex
+ pdflatex $^
+ pdflatex $^
+
+%.tex: %.xml
+ dblatex -t tex -b xetex $^
+ perl -p -i -e 's/\[latin1\]\{inputenc\}/[utf8]{inputenc}\n\\usepackage[spanish]{babel}/' $@
+ perl -p -i -e 's/\\caption\\end/\\caption{} \\end/' $@
+ perl -p -i -e 's/\\author\{and\}/\\author{Paul Stacey \\and Sarah Hinchliff Pearson}/' $@
XMLLINTOPTS = --nonet --noout --xinclude --postvalid
lint: $(SOURCE).xml