Sha256: 350ff0f1ad562b87d8f2490b273fa5f8ecc5e111e74c3697e5e370424406c3ee

Contents?: true

Size: 942 Bytes

Versions: 5

Compression:

Stored size: 942 Bytes

Contents

require "relaton-render"
require "metanorma-iso"
require "isodoc"
require_relative "parse"

module Relaton
  module Render
    module Jis
      class General < ::Relaton::Render::Iso::General
        def config_loc
          YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
        end

        def klass_initialize(_options)
          super
          @parseklass = Relaton::Render::Jis::Parse
        end

        def render1(doc)
          r = doc.relation.select { |x| x.type == "hasRepresentation" }
            .map { |x| @i18n.also_pub_as + render_single_bibitem(x.bibitem) }
          out = [render_single_bibitem(doc)] + r
          @i18n.l10n(out.join(". ").gsub(/[.。]\. /, ". ").sub(/[.。]\s*$/, ""))
        end

        def render_all(bib, type: "author-date")
          ret = super
          ret&.each_value { |k| k[:formattedref]&.sub!(/[.。]\s*$/, "") }
          ret
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metanorma-jis-0.4.5 lib/relaton/render-jis/general.rb
metanorma-jis-0.4.4 lib/relaton/render-jis/general.rb
metanorma-jis-0.4.3 lib/relaton/render-jis/general.rb
metanorma-jis-0.4.2 lib/relaton/render-jis/general.rb
metanorma-jis-0.4.1 lib/relaton/render-jis/general.rb