Sha256: 3cd7fa047623419e9284228efb8a7d1b59e670bdc94436488601904b440e8900

Contents?: true

Size: 785 Bytes

Versions: 25

Compression:

Stored size: 785 Bytes

Contents

module Bolognese
  module Writers
    module BibtexWriter
      def bibtex
        return nil unless valid?

        bib = {
          bibtex_type: bibtex_type.presence || "misc",
          bibtex_key: id,
          doi: doi,
          url: url,
          author: authors_as_string(author),
          keywords: Array.wrap(parse_attributes(keywords, content: "text")).join(", "),
          language: language,
          title: parse_attributes(title, content: "text", first: true),
          journal: container_title,
          volume: volume,
          issue: issue,
          pages: [first_page.to_s, last_page.to_s].join("-").presence,
          publisher: publisher,
          year: publication_year
        }.compact
        BibTeX::Entry.new(bib).to_s
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
bolognese-0.9.82 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.81 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.80 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.79 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.78 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.77 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.76 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.75 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.74 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.73 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.72 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.71 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.70 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.69 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.68 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.67 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.66 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.65 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.64 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.63 lib/bolognese/writers/bibtex_writer.rb