X-Git-Url: https://pere.pagekite.me/gitweb/text-madewithcc.git/blobdiff_plain/106bcd2048b67ae0900ee883aa67243cadd6a1b8..7aca5d66dd2a901b87193269e355fe84ec8a1c0a:/Makefile diff --git a/Makefile b/Makefile index 5c71457..d0aef0b 100644 --- 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 +all: pdf epub 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 @@ -63,13 +78,17 @@ pdf: $(SOURCE).pdf pdflatex $^ pdflatex $^ +epub: $(SOURCE).epub +%.epub: %.xml + dbtoepub $^ + %.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//; \ @@ -85,5 +104,9 @@ pdf: $(SOURCE).pdf XMLLINTOPTS = --nonet --noout --xinclude --postvalid lint: $(SOURCE).xml xmllint $(XMLLINTOPTS) $^ +lint-es: $(SOURCE).nb.xml + xmllint $(XMLLINTOPTS) $^ +lint-nb: $(SOURCE).nb.xml + xmllint $(XMLLINTOPTS) $^ .SUFFIXES: .xml .md