]> pere.pagekite.me Git - text-madewithcc.git/commitdiff
Playing with the document generation - Focusing in Spanish right now
authorGunnar Wolf <gwolf@gwolf.org>
Fri, 13 Oct 2017 17:39:26 +0000 (12:39 -0500)
committerGunnar Wolf <gwolf@gwolf.org>
Fri, 13 Oct 2017 17:39:26 +0000 (12:39 -0500)
Makefile

index 34418ba2f1285c1d2bdf5930d635ce08d7f1cd72..358acb7a5427d0896e84e5fe5395c3b2b73050f7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,8 @@
+#
+# 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
@@ -5,9 +10,9 @@ SOURCE=MadewithCreativeCommonsmostup-to-dateversion
 # 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
 
@@ -44,11 +49,20 @@ $(SOURCE).es.md: $(SOURCE).md po/es/mwcc.po
        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