Module: TaxonWorks::Vendor::BibtexRuby

Defined in:
lib/vendor/bibtex_ruby.rb

Class Method Summary collapse

Class Method Details

.bibliography(sources) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/vendor/bibtex_ruby.rb', line 8

def self.bibliography(sources)
  b = BibTeX::Bibliography.new
  sources.each do |s|
    next unless s.is_bibtex?
    e = s.to_bibtex
    e.year = '0000' if e.year.blank? # cludge to fix render problem with year
    b.add(e)
  end
  b
end

.styled(sources = [], style_id = 'http://www.zotero.org/styles/vancouver') ⇒ Object

of styled sources



21
22
23
24
# File 'lib/vendor/bibtex_ruby.rb', line 21

def self.styled(sources = [], style_id = 'http://www.zotero.org/styles/vancouver')
  return [] unless s = ::CSL_STYLES[style_id]
  sources.collect{|b| b.render_with_style(style_id) }.sort
end