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
citations_search(bib, search_key, author = nil)
click to toggle source
# File lib/middleman-bibtex.rb, line 9 def citations_search(bib, search_key, author = nil) entries_matching_key = bib.query(search_key) entries = if author then search_by_author(entries_matching_key, author) else entries_matching_key end entries .sort_by { |x| x.year.to_i } .map(&:key) end