Sha256: 47eeb340d6050273d17689bc14564ce25dd7086e2a2a247d6e0cf909d513a5d4

Contents?: true

Size: 998 Bytes

Versions: 3

Compression:

Stored size: 998 Bytes

Contents

module IsoDoc
  class Convert < ::IsoDoc::Common
    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)
      @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 l10n(expr, lang = @lang, script = @script, locale = @locale)
      @i18n.l10n(expr, lang, script, locale)
    end

    def toc_init(docxml)
      x = "//metanorma-extension/presentation-metadata" \
          "[name[text() = 'TOC Heading Levels']]/value"
      n = docxml.at(ns(x.sub(/TOC/, "DOC TOC"))) and
        @wordToClevels = n.text.to_i
      n = docxml.at(ns(x.sub(/TOC/, "HTML TOC"))) and
        @htmlToClevels = n.text.to_i
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
isodoc-2.5.1 lib/isodoc/init.rb
isodoc-2.5.0 lib/isodoc/init.rb
isodoc-2.4.5 lib/isodoc/init.rb