Sha256: 2b7ede3822788a2049b2b69a8df87e112f8bcc1fe46efd3156e578489545b9c6
Contents?: true
Size: 1021 Bytes
Versions: 88
Compression:
Stored size: 1021 Bytes
Contents
# frozen_string_literal: true module Bolognese module Writers module BibtexWriter def bibtex return nil unless valid? pages = container.to_h["firstPage"].present? ? [container["firstPage"], container["lastPage"]].join("-") : nil bib = { bibtex_type: types["bibtex"].presence || "misc", bibtex_key: normalize_doi(doi), doi: doi, url: url, author: authors_as_string(creators), keywords: subjects.present? ? Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.join(", ") : nil, language: language, title: parse_attributes(titles, content: "title", first: true), journal: container && container["title"], volume: container.to_h["volume"], issue: container.to_h["issue"], pages: pages, publisher: publisher, year: publication_year }.compact BibTeX::Entry.new(bib).to_s end end end end
Version data entries
88 entries across 88 versions & 1 rubygems