Sha256: 2435b2d4c9830ceb70ec595006921ca6b51a7f622db0bef22847039a4832c919

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

require "isodoc"
require_relative "metadata"
require_relative "xref"

module IsoDoc
  module IHO
    module Init
      def metadata_init(lang, script, locale, labels)
        @meta = Metadata.new(lang, script, locale, labels)
      end

      def xref_init(lang, script, _klass, labels, options)
        html = HtmlConvert.new(language: lang, script: script)
        @xrefs = Xref.new(lang, script, html, labels, options)
      end

      def i18n_init(lang, script, locale, i18nyaml = nil)
        @i18n = I18n.new(
          lang, script, locale: locale,
                        i18nyaml: i18nyaml ||
          Metanorma::IHO.configuration.i18nyaml || @i18nyaml
        )
      end

      def bibrenderer(options = {})
        ::Relaton::Render::IHO::General.new(options.merge(language: @lang,
                                                          i18nhash: @i18n.get))
      end

      def info(isoxml, out)
        @meta.series isoxml, out
        super
      end

      def omit_docid_prefix(prefix)
        return true if prefix == "IHO"

        super
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
metanorma-iho-1.0.4 lib/isodoc/iho/init.rb
metanorma-iho-1.0.3 lib/isodoc/iho/init.rb
metanorma-iho-1.0.2 lib/isodoc/iho/init.rb
metanorma-iho-1.0.1 lib/isodoc/iho/init.rb
metanorma-iho-1.0.0 lib/isodoc/iho/init.rb
metanorma-iho-0.9.12 lib/isodoc/iho/init.rb
metanorma-iho-0.9.11 lib/isodoc/iho/init.rb
metanorma-iho-0.9.9 lib/isodoc/iho/init.rb
metanorma-iho-0.9.8 lib/isodoc/iho/init.rb
metanorma-iho-0.9.7 lib/isodoc/iho/init.rb
metanorma-iho-0.9.6 lib/isodoc/iho/init.rb
metanorma-iho-0.9.5 lib/isodoc/iho/init.rb
metanorma-iho-0.9.4 lib/isodoc/iho/init.rb
metanorma-iho-0.9.3 lib/isodoc/iho/init.rb