Skip to content

Commit

Permalink
making wiki.sh more quiet. fixing bug in skim.rb when there are no an…
Browse files Browse the repository at this point in the history
…notations
  • Loading branch information
houshuang committed Dec 5, 2011
1 parent 2f8b581 commit 855afc2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 0 additions & 4 deletions clean_id.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ function cleanID($raw_id){

//alternative namespace seperator
$id = strtr($id,';',':');
if($conf['useslash']){
$id = strtr($id,'/',':');
}else{
$id = strtr($id,'/',$sepchar);
}

$id = utf8_romanize($id);
$id = utf8_deaccent($id,-1);
Expand Down
16 changes: 15 additions & 1 deletion skim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,21 @@ def format(type, text, page)
Citekey = docu
filename = dt.document.file.get[0].to_s
`/Applications/Skim.app/Contents/SharedSupport/skimnotes get -format text #{filename}`
a = File.readlines("#{PDF_path}/#{docu}.txt")


# make sure the metadata page is written
ensure_refpage(docu)

fname = "#{PDF_path}/#{docu}.txt"

# if no annotations, we're done
unless File.exists?(fname)
growl "Skim did not export any data. Either you have not made any highlights, or there is an error (check the paths in settings.rb). Just creating the ref: page with metadata."
`open http://localhost/wiki/ref:#{docu}`
exit(0)
end

File.readlines(fname)

page = nil
@out = Array.new
Expand Down
4 changes: 2 additions & 2 deletions wiki.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
rm -rf /wiki/data/cache/*
rsync --exclude .htaccess --delete -avzPe ssh /Library/WebServer/Documents/wiki [email protected]:~/public_html
rsync --exclude .htaccess --delete --stats -qazPe ssh /Library/WebServer/Documents/wiki [email protected]:~/public_html
ssh [email protected] 'chmod -R 755 ~/public_html/wiki/*; chmod 755 ~/public_html/wiki;touch ~/public_html/wiki/conf/dokuwiki.php'
gunzip /wiki/sitemap.xml.gz
ruby -pe 'gsub("localhost","reganmian.net")' < /wiki/sitemap.xml > /wiki/sitemap-tmp.xml
mv /wiki/sitemap-tmp.xml /wiki/sitemap.xml
gzip /wiki/sitemap.xml
rsync --delete -avzPe ssh /wiki/sitemap.xml.gz [email protected]:~/public_html/
rsync --delete -aqzPe ssh /wiki/sitemap.xml.gz [email protected]:~/public_html/

0 comments on commit 855afc2

Please sign in to comment.