# increase every time the generated Markdown is modified.
VERSION=20170609-2
-TITLE="Hecho con Creative Commons"
TEXLANG=spanish
TEXLANGCODE=es
-#TITLE="Laget med Creative Commons"
#TEXLANG=norsk
#TEXLANGCODE=nb
--standalone \
--top-level-division=part \
-t docbook \
- -f markdown+inline_notes+ascii_identifiers \
- --variable 'author:Paul Stacey' --variable 'author:Sarah Hinchliff Pearson' \
- --variable 'title:$(TITLE)'
+ -f markdown+inline_notes+ascii_identifiers
LANGS := $(shell ls po/*/mwcc.po|cut -d/ -f2)
rm $$TEMP
pot: po/mwcc.pot po/*/mwcc.po
-po/mwcc.pot: $(SOURCE).md
+po/mwcc.pot: $(SOURCE).xml
TEMP=`tempfile -p mwcc` && \
- po4a-gettextize -f text -m $(SOURCE).md -p $$TEMP -M utf-8 --package-name 'Made with Creative Commons' --package-version $(VERSION) && \
+ po4a-gettextize -f docbook -m $(SOURCE).xml -p $$TEMP -M utf-8 --package-name 'Made with Creative Commons' --package-version $(VERSION) && \
echo '# MADE WITH CREATIVE COMMONS' > $@ && \
echo '# Copyright (C) 2017 by Creative Commons.' >> $@ && \
echo '# This file is published under a Creative Commons Attribution-ShareAlike license (CC BY-SA), version 4.0' >> $@ && \
msgmerge --previous $@ po/mwcc.pot -U
touch $@
-$(SOURCE).es.md: $(SOURCE).md po/es/mwcc.po
- po4a-translate -f text -m $(SOURCE).md -p po/es/mwcc.po -l $@ -l $@ -L utf-8 -M utf-8 -k 0
+$(SOURCE).es.xml: $(SOURCE).xml po/es/mwcc.po
+ po4a-translate -f docbook -m $(SOURCE).xml -p po/es/mwcc.po -l $@ -l $@ -L utf-8 -M utf-8 -k 0
-$(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
+$(SOURCE).nb.xml: $(SOURCE).xml po/nb/mwcc.po
+ po4a-translate -f docbook -m $(SOURCE).xml -p po/nb/mwcc.po -l $@ -l $@ -L utf-8 -M utf-8 -k 0
-%.xml: %.md
+$(SOURCE).xml: $(SOURCE).md fixup-docbook.rb
TEMP=`tempfile -p mwcc` && \
- pandoc -s -o $$TEMP $(PANDOC_OPTS) $^ && \
+ pandoc -s -o $$TEMP $(PANDOC_OPTS) $(SOURCE).md && \
ruby fixup-docbook.rb $$TEMP $@ && \
rm $$TEMP
s/\\author\{and\}/\\author{Paul Stacey \\and Sarah Hinchliff Pearson}/; \
s/\\DBKinditem\{\\writtenby\}\{and\}/\\DBKinditem{\writtenby}{Paul Stacey and Sarah Hinchliff Pearson}/; \
s/\\listoffigures//; \
- s/\\part\{(Foreword|Prefacio|Introduction|Introducción)\}/\\chapter*{$$1} \\addcontentsline{toc}{chapter}{$$1}/; \
+ s/\\chapter\{(Colophon|Dedication)\}/\\chapter*{}/; \
+ s/\\chapter\{(Foreword|Prefacio|Introduction|Introducción)\}/\\chapter*{$$1} \\addcontentsline{toc}{chapter}{$$1}/; \
s/\\section\{(Notes|Notas)\}/\\section*{$$1}/; \
s/(Web links?|Vínculos Web)/\\section*{$$1}/; \
s/^\s*(Revenue model|Interview date|Interviewees?|(Modelo de ingresos|Fecha de la entrevista|Entrevistad(?:o|a|os|as)))/\\textbf{$$1}/;' $@
data.delete("# Part 1")
data.delete("# Part 2")
+log 0, 'add heading to colophon page'
+data.insert(data.index('Made With Creative Commons'), '## Colophon {-}')
+
+log 0, 'add dedication as separeate chapter'
+data.insert(data.index('“I don’t know a whole lot about nonfiction journalism. . .'), '## Dedication {-}')
+
# Join erroneously split paragraphs: Write the contents of the line
# _preceding_ the unneeded break, the break will be removed.
#