]> pere.pagekite.me Git - text-madewithcc.git/blobdiff - Makefile
Markup fixes
[text-madewithcc.git] / Makefile
index 5d83a651e53614f3d712fab60b9e22ec917f804a..85b7c7a7ce35d678ce4ecc6e4342814c9aad9fa6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,8 +50,8 @@ $(SOURCE).es.md: $(SOURCE).md po/es/mwcc.po
 
 %.xml: %.md
        pandoc -s -o $@ $(PANDOC_OPTS) $^
 
 %.xml: %.md
        pandoc -s -o $@ $(PANDOC_OPTS) $^
-       perl -p -i -e 's/!DOCTYPE article/!DOCTYPE book/' $@
-       perl -p -i -e 's!<(/?)article(info|)?>!<$$1book$$2>!' $@
+       perl -p -i -e 's/!DOCTYPE article/!DOCTYPE book/ ; \
+               s!<(/?)article(info|)?>!<$$1book$$2>!' $@
 
 pdf: $(SOURCE).pdf
 %.pdf: %.tex
 
 pdf: $(SOURCE).pdf
 %.pdf: %.tex
@@ -60,10 +60,18 @@ pdf: $(SOURCE).pdf
 
 %.tex: %.xml
        dblatex -t tex -b xetex $^
 
 %.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}/' $@
-       perl -p -i -e 's/\\DBKinditem\{\\writtenby\}\{and\}/\\DBKinditem{\writtenby}{Paul Stacey and Sarah Hinchliff Pearson}/' $@
+       perl -p -i -e 's/\[latin1\]\{inputenc\}/[utf8]{inputenc}\n\\usepackage[spanish]{babel}/; \
+               s/\\caption\\end/\\caption{} \\end/; \
+               s/\\author\{and\}/\\author{Paul Stacey \\and Sarah Hinchliff Pearson}/; \
+               s/\\DBKinditem\{\\writtenby\}\{and\}/\\DBKinditem{\writtenby}{Paul Stacey and Sarah Hinchliff Pearson}/; \
+               s/\\part\{(Prefacio|Introducción)\}/\\chapter*{$$1} \\addcontentsline{toc}{chapter}{$$1}/; \
+               s/\\section\{Notas\}/\\section*{Notas}/; \
+               s/(Vínculos Web)/\\section*{$$1}/; \
+               s/^\s*(Modelo de ingresos|Fecha de la entrevista|Entrevistad(?:o|a|os|as))/\\textbf{$$1}/;' $@
+       perl -p -i -e '$$work=1 if /chapter.Arduino/; $$work=0 if /chapter.Bibliografía/; \
+               next unless $$work; \
+               s/(\\label\{[-\.\wáéíóúñ]+\}\\hyperlabel\{[-\.\wáéíóúñ]+\}%)/$$1\n\\begin{quote}/i; \
+               s/(Perfil escrito por.+)/$$1\n\\end{quote}/' $@
 
 XMLLINTOPTS = --nonet --noout  --xinclude --postvalid
 lint: $(SOURCE).xml
 
 XMLLINTOPTS = --nonet --noout  --xinclude --postvalid
 lint: $(SOURCE).xml