-
Notifications
You must be signed in to change notification settings - Fork 1
/
render-publication.rb
executable file
·54 lines (45 loc) · 1.13 KB
/
render-publication.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/ruby
require 'rubygems'
require 'rbosa'
require 'render-bibliography'
def render_publication(key)
bd = OSA.app('BibDesk')
# puts "====> #{bd} <======="
# puts "====> #{bd.search(bd.documents[0],key)} <====="
p = bd.search(bd.documents[0],key)[0]
raise "publication with key '#{key}' doesn't exist" if p.nil?
# puts "====> #{p} <======="
pubtype = p.type2
# puts "====> #{pubtype} <======="
case pubtype
when "article"
return render_article(p)
when "book"
return render_book(p)
when "booklet"
return render_booklet(p)
when "conference"
return render_conference(p)
when "inbook"
return render_inbook(p)
when "inproceedings"
return render_inproceedings(p)
when "manual"
return render_manual(p)
when "mastersthesis"
return render_mastersthesis(p)
when "misc"
return render_misc(p)
when "phdthesis"
return render_phdthesis(p)
when "proceedings"
return render_proceedings(p)
when "techreport"
return render_techreport(p)
when "unpublished"
return render_unpublished(p)
else
raise "not implemented"
end
end
#puts render_publication(ARGV[0])