summaryrefslogtreecommitdiff
path: root/Makefile
blob: ba6c77d46a01afc1e76d99585b98d0fe5e9b3c72 (plain)
  1. stem = eut
  2. source_baseurl = http://euwiki.org/
  3. source_basename = EUT/2nd-edition
  4. # work around in mediawiki bug parsing blockquote tags on same line
  5. re_blockquote = s|\n*(</?blockquote>)\n*|\n$$1\n|g
  6. export PANDOC_CITEPROC_FILE = $(stem).bib
  7. #PANDOC_CITEPROC_FILE = $(stem).bib
  8. all: $(stem).pdf
  9. download:
  10. wget -o $(stem).raw '$(source_baseurl)index.php?title=$(source_basename)&action=edit'
  11. $(stem).mediawiki: $(stem).raw
  12. perl -0777 -MHTML::Entities -p \
  13. -e 's|.*<textarea[^>]*>||s; s|</textarea.*||s;' \
  14. -e 'decode_entities($$_);' \
  15. -e 's|.*?\n= |= |s;' \
  16. -e 's|<!--.*-->||s;' \
  17. -e '$(re_blockquote);' \
  18. < $< > $@
  19. $(stem).pdf: $(stem).mediawiki template.tex
  20. pandoc -f mediawiki --template=template.tex --latex-engine=xelatex \
  21. --filter ./pandoc-filter-sections --filter ./pandoc-filter-bib \
  22. --bibliography=$(PANDOC_CITEPROC_FILE) \
  23. -V mainfont="Lora" -V sansfont="Quattrocento Sans" -V monofont="Inconsolata" \
  24. -V papersize=a4paper -V fontsize=10pt \
  25. -V documentclass=memoir -V headstyles=komalike -V chapterstyle=ell \
  26. -V classoption=oneside -V classoption=titlepage \
  27. -V lang=english -V langoption=variant=british \
  28. -V title="Ensuring utmost transparency" \
  29. -V subtitle="Free Software and Open Standards under the Rules of Procedure of the European Parliament" \
  30. -V author="Carlo Piana" -V author="Ulf Öberg" \
  31. -V date="" \
  32. -o $@ $<