class Middleman::BibtexExtension

Public Class Methods

new(app, options_hash = {}, &block) click to toggle source
Calls superclass method
# File lib/middleman-bibtex.rb, line 53
def initialize(app, options_hash = {}, &block)
  super
  app.config[:bib] = BibTeX.open(options.path)
  app.config[:cite_style] = options.style
  app.config[:cite_format] = options.format
end

Public Instance Methods

citation(key) click to toggle source
# File lib/middleman-bibtex.rb, line 78
def citation(key)
  citation_formatted(citation_entry(key))
end
citation_entry(key) click to toggle source
# File lib/middleman-bibtex.rb, line 67
def citation_entry(key)
  bib = app.config[:bib]
  BibtexHelper.citation_entry(bib, key)
end
citation_formatted(entry) click to toggle source
# File lib/middleman-bibtex.rb, line 72
def citation_formatted(entry)
  style = app.config[:cite_style]
  format = app.config[:cite_format]
  BibtexHelper.citation_formatted(entry, style, format)
end