Sha256: 291386351fa74cc3bef569b4f86c93a87e6b02266839a97cb8441eba05e8718b

Contents?: true

Size: 993 Bytes

Versions: 16

Compression:

Stored size: 993 Bytes

Contents

module Bolognese
  module Writers
    module CiteprocWriter
      def citeproc
        return nil unless valid?

        hsh = {
          "type" => citeproc_type,
          "id" => id,
          "categories" => keywords.present? ? keywords.split(", ") : nil,
          "language" => language,
          "author" => to_citeproc(author),
          "editor" => to_citeproc(editor),
          "issued" => get_date_parts(date_published),
          "submitted" => get_date_parts(date_submitted),
          "abstract" => parse_attributes(description, content: "text", first: true),
          "container-title" => container_title,
          "DOI" => doi,
          "issue" => issue,
          "page" => pagination,
          "publisher" => publisher,
          "title" => parse_attributes(title, content: "text", first: true),
          "URL" => url,
          "version" => version,
          "volume" => volume
        }.compact
        JSON.pretty_generate hsh.presence
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bolognese-0.9.36 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.35 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.34 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.33 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.32 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.31 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.30 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.29 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.28 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.27 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.26 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.25 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.24 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.23 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.22 lib/bolognese/writers/citeproc_writer.rb
bolognese-0.9.21 lib/bolognese/writers/citeproc_writer.rb