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