module BibtexHelper

Public Instance Methods

citation_entry(bib, key) click to toggle source
# File lib/middleman-bibtex.rb, line 26
def citation_entry(bib, key)
  unless entry = bib[key] then
    message = format('No entry for key %s', key)
    raise Middleman::Bibtex::KeyNotFound, message
  end
  entry.convert_latex.to_citeproc
end
citation_formatted(entry, style, format) click to toggle source
# File lib/middleman-bibtex.rb, line 22
def citation_formatted(entry, style, format)
  CiteProc.process(entry, :style => style, :format => format)
end
search_by_author(entries, author) click to toggle source
# File lib/middleman-bibtex.rb, line 34
def search_by_author(entries, author)
  bib_author = BibTeX::Name.parse(author)
  entries.select do |e|
    e.respond_to?(:author) &&
      e.author &&
      e.author.include?(bib_author)
  end
end