lib/whedon/bibtex.rb
# Generates the <citations></citations> XML block for Crossref
# Returns an XML fragment <citations></citations> with or
# without citations within
# TODO: should probably use Ruby builder templates here
Generates the  XML block for Crossref
Returns an XML fragment  with or
without citations within
TODO: should probably use Ruby builder templates here
Generates the XML block for Crossref Returns an XML fragment with or without citations within TODO : should probably use Ruby builder templates here
def generate_citations(citations=nil)
      entries = BibTeX.open(@bib_file, :filter => :latex)
      if entries.empty?
        @citation_string = ""
      else
        entries.each do |entry|
          next if entry.comment?
          if citations
            next unless citations.include?("@#{entry.key}")
          end
          @citation_string << make_citation(entry)
          @ref_count += 1
        end
      end
      doc = Nokogiri::XML("<citation_list>#{@citation_string}</citation_list>")
      return doc.root.to_xml
    end
def generate_citations ( citations = nil ) entries = BibTeX . open ( @bib_file , :filter => :latex ) if entries . empty? @citation_string = "" else entries . each do | entry | next if entry . comment? if citations next unless citations . include? ( "@#{entry.key}" ) end @citation_string << make_citation ( entry ) @ref_count += 1 end end doc = Nokogiri :: XML ( "<citation_list>#{@citation_string}</citation_list>" ) return doc . root . to_xml end
Generates the <citations></citations> XML block for Crossref
Returns an XML fragment <citations></citations> with or
without citations within
TODO: should probably use Ruby builder templates here
Generates the <citations > < / citations > XML block for Crossref Returns an XML fragment <citations > < / citations > with or without citations within TODO : should probably use Ruby builder templates here
# This Nokogiri step is simply to pretty-print the XML of the citations
citations
<not_specific>