Merge branch 'master' of ssh://fo.am/foam/futurist-fieldguide
This commit is contained in:
commit
34f8dac69a
2 changed files with 19 additions and 7 deletions
Binary file not shown.
18
printable.rb
18
printable.rb
|
@ -2,13 +2,24 @@
|
||||||
#
|
#
|
||||||
# dokuwiki -> pdf conversion for futurist fieldguide
|
# dokuwiki -> pdf conversion for futurist fieldguide
|
||||||
|
|
||||||
|
require "slop"
|
||||||
|
|
||||||
|
opts = Slop.parse do
|
||||||
|
banner 'Usage: printable.rb [options]'
|
||||||
|
on 'file=', 'source file basename'
|
||||||
|
on 'v', 'verbose', 'enable verbose mode'
|
||||||
|
on 'g', 'git', 'commit new files to git repo'
|
||||||
|
end
|
||||||
|
|
||||||
repo="/home/nik/pandoc/futurist-fieldguide/"
|
repo="/home/nik/pandoc/futurist-fieldguide/"
|
||||||
doku="/var/www/libarynth/dokuwiki/data/pages/futurist_fieldguide/"
|
doku="/var/www/libarynth/dokuwiki/data/pages/futurist_fieldguide/"
|
||||||
user="www-data"
|
user="www-data"
|
||||||
|
|
||||||
# Dir['*.txt']
|
#file=ARGV[0] # dokuwiki pagenme as argument (no opts)
|
||||||
|
|
||||||
file=ARGV[0] # dokuwiki pagenme as argument
|
file = opts[:file]
|
||||||
|
|
||||||
|
puts file
|
||||||
|
|
||||||
# parse dokuwiki -> html
|
# parse dokuwiki -> html
|
||||||
`php /var/www/libarynth/dokuwiki/bin/dokucli.php < #{doku}/#{file}.txt > /tmp/#{file}.html`
|
`php /var/www/libarynth/dokuwiki/bin/dokucli.php < #{doku}/#{file}.txt > /tmp/#{file}.html`
|
||||||
|
@ -29,9 +40,10 @@ file=ARGV[0] # dokuwiki pagenme as argument
|
||||||
# - assuming the script is run in #{repo} and has origin ssh://git@repo.fo.am:foam/futurist-fieldguide.git
|
# - 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
|
# - otherwise perhaps https://github.com/schacon/ruby-git
|
||||||
|
|
||||||
|
if opts.git?
|
||||||
`git add -A`
|
`git add -A`
|
||||||
`git commit -m "#{file}"`
|
`git commit -m "#{file}"`
|
||||||
`git pull --commit`
|
`git pull --commit`
|
||||||
`git push`
|
`git push`
|
||||||
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue