Sha256: 62f470aeb57f903d8bb6c79a7dc4d50faec8cdd4b7c5546468852ec5003ee7f8

Contents?: true

Size: 1.11 KB

Versions: 19

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module Bolognese
  module Writers
    module CiteprocWriter
      def citeproc
        hsh = {
          "type" => citeproc_type,
          "id" => identifier,
          "categories" => Array.wrap(keywords).map { |k| parse_attributes(k, content: "text", first: true) }.presence,
          "language" => language,
          "author" => to_citeproc(author),
          "editor" => to_citeproc(editor),
          "issued" => date_published ? get_date_parts(date_published) : nil,
          "submitted" => date_submitted ? get_date_parts(date_submitted) : nil,
          "abstract" => parse_attributes(description, content: "text", first: true),
          "container-title" => container_title,
          "DOI" => doi,
          "issue" => issue,
          "page" => [first_page, last_page].compact.join("-").presence,
          "publisher" => publisher,
          "title" => parse_attributes(title, content: "text", first: true),
          "URL" => b_url,
          "version" => b_version,
          "volume" => volume
        }.compact
        JSON.pretty_generate hsh.presence
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
bolognese-0.14.1 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.14 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.13.6 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.13.4 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.13.3 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.13.2 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.13.1 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.12.3 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.12.2 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.12.1 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.12 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.11.7 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.11.6 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.11.5 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.11.4 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.11.3 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.11.1 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.11 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.10.22 lib/bolognese/writers/citeproc_writer.rb