Sha256: 75db32500965c80e110adeb8706982ba2da01907491c1e20952583da50a0717b

Contents?: true

Size: 743 Bytes

Versions: 29

Compression:

Stored size: 743 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: pagination,
          publisher: publisher,
          year: publication_year
        }.compact
        BibTeX::Entry.new(bib).to_s
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
bolognese-0.9.56 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.55 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.54 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.52 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.51 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.50 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.48 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.44 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.43 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.42 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.41 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.39 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.38 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.37 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.36 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.35 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.34 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.33 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.32 lib/bolognese/writers/bibtex_writer.rb
bolognese-0.9.31 lib/bolognese/writers/bibtex_writer.rb