futurist-fieldguide/printable.rb

25 lines
765 B
Ruby
Raw Normal View History

2015-05-26 17:39:55 +00:00
#!/usr/local/bin/ruby
#
# dokuwiki -> pdf conversion for futurist fieldguide
repo="/home/nik/pandoc/futurist-fieldguide/"
doku="/var/www/libarynth/dokuwiki/data/pages/futurist_fieldguide/"
user="www-data"
2015-05-26 17:47:24 +00:00
# Dir['*.txt']
2015-05-26 17:39:55 +00:00
2015-05-26 17:47:24 +00:00
file=ARGV[0] # dokuwiki pagenme as argument
2015-05-26 17:39:55 +00:00
# parse dokuwiki -> html
`php /var/www/libarynth/dokuwiki/bin/dokucli.php < #{doku}/#{file}.txt > /tmp/#{file}.html`
# convert html -> pdf with pandoc
# extra html step to create self-contained (local) images
`pandoc /tmp/#{file}.html --self-contained -o /tmp/#{file}.html`
2015-05-26 17:50:25 +00:00
`pandoc /tmp/#{file}.html -S --template=#{repo}/pandoc/templates/fieldguide.tex --include-in-header=#{repo}/pandoc/header.tex --latex-engine=xelatex -o #{repo}/print/#{file}.pdf`
2015-05-26 19:28:53 +00:00
2015-05-27 05:11:07 +00:00
# merge single pdfs with 'assemble.rb'
2015-05-26 19:28:53 +00:00