Sha256: 826b9b679b9e414d458bfa3071d8a1e0dff2e2ad87ab7b8e42e1e46364d6eafe
Contents?: true
Size: 764 Bytes
Versions: 33
Compression:
Stored size: 764 Bytes
Contents
require 'rubygems' require 'bibtex' # Open a bibliography file bib = BibTeX.open File.expand_path('../markdown.bib',__FILE__), :include => [:meta_content] # Replaces all strings in the Bibliography and then # converts each BibTeX entries to a string using Chicago style # (all other elements are mapped to simple strings) begin require 'citeproc' rescue LoadError puts 'this example depends on the citeproc-ruby gem' exit end content = bib.replace.q('@entry, @meta_content').map do |b| if b.entry? CiteProc.process b.to_citeproc else b.to_s end end begin require 'redcarpet' rescue LoadError puts 'this example depends on the redcarpet gem' exit end puts Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(content.join)
Version data entries
33 entries across 33 versions & 1 rubygems