Sha256: 42f8fff8819f9dce9c56b44d54d0570f023c8c110f6156a8247efef62a8ffb47
Contents?: true
Size: 593 Bytes
Versions: 24
Compression:
Stored size: 593 Bytes
Contents
require 'bibmarkdown' require 'bibtex' require 'csl/styles' # Sets the default directory of citation styles. CSL::Style.root = File.dirname(__FILE__) + '/../citationstyles' # Define a citation filter using bibmarkdown Nanoc::Filter.define(:scholar_citation) do |content, params| bib = params[:bibfile] if not bib raise "Could not find bibliography file" end entries = BibTeX.parse(bib.raw_content).entries entries.each_value { |e| e.convert!(:latex) { |key| key != :url } } params = params.merge(entries: entries) BibMarkdown::Document.new(content, params).to_markdown end
Version data entries
24 entries across 24 versions & 1 rubygems