-# Replace Unicode Hair Space (U+200A) with space, as   is not
-# handled by LaTeX/dblatex, see <URL: https://bugs.debian.org/889603 >.
-%.tex: %.xml
- dblatex -t tex -b xetex $^
- perl -p -i -e 's/\[latin1\]\{inputenc\}/[utf8]{inputenc}\n\\usepackage[$(TEXLANG)]{babel}/; \
- s/ / /g; \
- s/\\setcounter\{tocdepth\}.*/\\setcounter{tocdepth}{1}/; \
- s/\\setcounter\{secnumdepth\}.*/\\setcounter{secnumdepth}{-1}/; \
- s/\\caption\\end/\\caption{} \\end/; \
- s!\\maketitle!\\input{extra/$(TEXLANGCODE)/cover.tex}!; \
- 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/\\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}/;' $@
- perl -p -i -e '$$work=1 if /chapter.Arduino/; $$work=0 if /chapter.(Bibliography|Bibliografía)/; \
- next unless $$work; \
- s/(\\label\{[-\.\wáéíóúñ]+\}\\hyperlabel\{[-\.\wáéíóúñ]+\}%)/$$1\n\\begin{quote}/i; \
- s/(Profile written by.+|Perfil escrito por.+|Profilen skrevet av.+)/$$1\n\\end{quote}/' $@
+html: $(SOURCE).html
+ for LANG in $(LANGS); do \
+ $(MAKE) $(SOURCE).$$LANG.html ; \
+ done
+
+%.html: %.xml
+ xmlto -x extra/docbook-utf8.xsl -m extra/pdf.xsl html-nochunks $^
+
+# Useful for spell checking the text
+%.txt: %.xml
+ xmlto txt $<