Sha256: efdbe216252079f0cfc05a59d28641560ea3693d0512a7b11eed90a72e3d790c

Contents?: true

Size: 791 Bytes

Versions: 7

Compression:

Stored size: 791 Bytes

Contents

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

        bib = {
          bibtex_type: bibtex_type.presence || "misc",
          bibtex_key: identifier,
          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, last_page].compact.join("-").presence,
          publisher: publisher,
          year: publication_year
        }.compact
        BibTeX::Entry.new(bib).to_s
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bolognese-0.9.89 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.88 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.87 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.86 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.85 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.84 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.83 lib/bolognese/writers/bibtex_writer.rb