blob: 1cd26e52ce8a44388644789c23fee8b9fef32997 (
plain)
- stem = eut
- source_baseurl = http://euwiki.org/
- source_basename = EUT/2nd-edition
- # work around in mediawiki bug parsing blockquote tags on same line
- re_blockquote = s|\n*(</?blockquote>)\n*|\n$$1\n|g
- export PANDOC_CITEPROC_FILE = $(stem).bib
- #PANDOC_CITEPROC_FILE = $(stem).bib
- all: $(stem).pdf
- download:
- wget -o $(stem).raw '$(source_baseurl)index.php?title=$(source_basename)&action=edit'
- $(stem).mediawiki: $(stem).raw
- perl -0777 -MHTML::Entities -p \
- -e 's|.*<textarea[^>]*>||s; s|</textarea.*||s;' \
- -e 'decode_entities($$_);' \
- -e 's|.*?\n= |= |s;' \
- -e 's|<!--.*-->||s;' \
- -e '$(re_blockquote);' \
- < $< > $@
- $(stem).pdf: $(stem).mediawiki template.tex
- pandoc -f mediawiki --template=template.tex --latex-engine=xelatex \
- --filter ./pandoc-filter-sections --filter ./pandoc-filter-bib \
- --bibliography=$(PANDOC_CITEPROC_FILE) \
- -V papersize=a4paper -V fontsize=11pt \
- -V documentclass=memoir -V chapterstyle=demo3 \
- -V classoption=oneside -V classoption=titlepage -V classoption=twocolumn \
- -V lang=english -V langoption=variant=british \
- -V title="Ensuring utmost transparency" \
- -V subtitle="Free Software and Open Standards under the Rules of Procedure of the European Parliament" \
- -V author="Carlo Piana" -V author="Ulf Öberg" \
- -V date="" \
- -o $@ $<
|