- ‘doku2tex.rb~’
This commit is contained in:
parent
e30bbbad9f
commit
ff440c490a
1 changed files with 0 additions and 48 deletions
48
doku2tex.rb~
48
doku2tex.rb~
|
@ -1,48 +0,0 @@
|
|||
#!/usr/local/bin/ruby
|
||||
#
|
||||
# dokuwiki -> pdf conversion for futurist fieldguide
|
||||
|
||||
require "slop"
|
||||
|
||||
opts = Slop.parse do |o|
|
||||
o.string '-f','--file', 'source file basename'
|
||||
o.bool '-v', '--verbose', 'enable verbose mode'
|
||||
o.bool '-g', '--git', 'commit new files to git repo'
|
||||
end
|
||||
|
||||
repo="/home/nik/pandoc/futurist-fieldguide/"
|
||||
doku="/var/www/libarynth/dokuwiki/data/pages/futurist_fieldguide/"
|
||||
user="www-data"
|
||||
|
||||
#file=ARGV[0] # dokuwiki pagenme as argument (no opts)
|
||||
|
||||
file = opts[:file]
|
||||
|
||||
puts file
|
||||
|
||||
# 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`
|
||||
|
||||
`pandoc /tmp/#{file}.html -S --template=#{repo}/pandoc/templates/fieldguide.tex \
|
||||
--include-in-header=#{repo}/pandoc/header.tex \
|
||||
--metadata=title-meta:#{file} \
|
||||
--latex-engine=xelatex -o #{repo}/print/#{file}.pdf`
|
||||
|
||||
# merge single pdfs with 'assemble.rb'
|
||||
|
||||
# gittery
|
||||
# - assuming the script is run in #{repo} and has origin ssh://git@repo.fo.am:foam/futurist-fieldguide.git
|
||||
# - otherwise perhaps https://github.com/schacon/ruby-git
|
||||
|
||||
if opts.git?
|
||||
`git add -A`
|
||||
`git commit -m "#{file}"`
|
||||
`git pull --commit`
|
||||
`git push`
|
||||
end
|
||||
|
Loading…
Reference in a new issue