]> pere.pagekite.me Git - text-madewithcc.git/commitdiff
Makefile cleanup to parametrize language builds
authorGunnar Wolf <gwolf@gwolf.org>
Wed, 17 Jan 2018 01:16:49 +0000 (19:16 -0600)
committerGunnar Wolf <gwolf@gwolf.org>
Wed, 17 Jan 2018 01:16:49 +0000 (19:16 -0600)
Makefile
extra/nb/cover.tex [new file with mode: 0644]

index 5c71457f87bf91360a90a8d2f58291a78f22a4e9..f90b740a7c94a8d66fd5fae6ba2feba9f85a1a10 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,20 +10,35 @@ 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'
+TITLE="Hecho con Creative Commons"
+TEXLANG=spanish
+TEXLANGCODE=es
+
+#TITLE="Laget med Creative Commons"
+#TEXLANG=norsk
+#TEXLANGCODE=nb
+
+PANDOC_OPTS = --top-level-division=part -t docbook -f markdown+inline_notes+ascii_identifiers \
+  --variable 'author:Paul Stacey' --variable 'author:Sarah Hinchliff Pearson' \
+  --variable 'title:$(TITLE)'
 # --top-level-diversion is not available in pandoc in Jessie
 # PANDOC_OPTS = -t docbook -f markdown+inline_notes
 
-LANGS = es nl nb
+LANGS = de es nb nl pl
 
 all: pdf
 
 distclean: clean
        rm -f $(SOURCE).md
-clean:
-       rm -f $(SOURCE).pdf $(SOURCE).xml
        for LANG in $(LANGS); do \
-           rm -f $(SOURCE).$$LANG.pdf $(SOURCE).$$LANG.xml $(SOURCE).$$LANG.md ;\
+           rm -f $(SOURCE).$$LANG.md ;\
+       done
+clean:
+       for EXT in aux cb cb2 glo idx lof log tex toc xml pdf; do \
+           rm -f $(SOURCE).$$EXT ;\
+           for LANG in $(LANGS); do \
+               rm -f $(SOURCE).$$LANG.$$EXT ;\
+           done; \
         done
 
 $(SOURCE).md: $(SOURCE).odt fixup.rb
@@ -65,11 +80,11 @@ pdf: $(SOURCE).pdf
 
 %.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/\[latin1\]\{inputenc\}/[utf8]{inputenc}\n\\usepackage[$(TEXLANG)]{babel}/; \
                s/\\setcounter\{tocdepth\}.*/\\setcounter{tocdepth}{1}/; \
                s/\\setcounter\{secnumdepth\}.*/\\setcounter{secnumdepth}{-1}/; \
                s/\\caption\\end/\\caption{} \\end/; \
-               s!\\maketitle!\\input{extra/es/cover.tex}!; \
+               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//; \
diff --git a/extra/nb/cover.tex b/extra/nb/cover.tex
new file mode 100644 (file)
index 0000000..41a0da3
--- /dev/null
@@ -0,0 +1,17 @@
+\begin{titlepage}
+  \thispagestyle{empty}
+  \begin{center}
+    ~ \vfill
+    \Huge
+    \textsc{Laget med Creative Commons}
+    \vskip 2cm
+    \Large
+    Paul Stacey og Sarah Hinchliff Pearson
+    \vskip 1cm
+    \large
+    Oversettere:\\
+    Ole-Erik Yrvin, Ingrid Yrvin, Allan Nordhøy og Petter Reinholdtsen
+  \end{center}
+
+  \vfill \eject
+\end{titlepage}