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
|
2015-05-27 08:20:15 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
2015-05-27 09:30:17 +00:00
|
|
|
# gittery - assuming the script is run in #{repo} and has orgin ssh://git@repo.fo.am:foam/futurist-fieldguide.git
|
|
|
|
|
|
|
|
# `git add -A`
|
|
|
|
# `git commit -m "#{msg}"`
|
|
|
|
# `git pull --commit`
|
|
|
|
# `git push`
|
|
|
|
|