Sha256: 37bb6d144dd1b2d77bf41f404f2b6daa47c349887c3ec57e2c9d3a8ac3ae947c

Contents?: true

Size: 1019 Bytes

Versions: 3

Compression:

Stored size: 1019 Bytes

Contents

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

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

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

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

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

      def fileloc(loc)
        File.join(File.dirname(__FILE__), loc)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metanorma-itu-2.5.8 lib/isodoc/itu/init.rb
metanorma-itu-2.5.6 lib/isodoc/itu/init.rb
metanorma-itu-2.5.5 lib/isodoc/itu/init.rb