Module: IsoDoc::Jis::Init

Included in:
HtmlConvert, PresentationXMLConvert, WordConvert
Defined in:
lib/isodoc/jis/init.rb

Instance Method Summary collapse

Instance Method Details

#bibrenderer(options = {}) ⇒ Object



22
23
24
25
# File 'lib/isodoc/jis/init.rb', line 22

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

#convert_i18n_init1(docxml) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/isodoc/jis/init.rb', line 31

def convert_i18n_init1(docxml)
  docxml.at("//xmlns:bibdata") or return
  lang = docxml.at("//xmlns:bibdata/xmlns:language") ||
    (docxml << "<language/>")
  %w(en ja).include?(lang&.text) or lang.content = "ja"
  super
end

#i18n_init(lang, script, locale, i18nyaml = nil) ⇒ Object



17
18
19
20
# File 'lib/isodoc/jis/init.rb', line 17

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

#metadata_init(lang, script, locale, labels) ⇒ Object



8
9
10
# File 'lib/isodoc/jis/init.rb', line 8

def (lang, script, locale, labels)
  @meta = .new(lang, script, locale, labels)
end

#std_docid_semantic(text) ⇒ Object



27
28
29
# File 'lib/isodoc/jis/init.rb', line 27

def std_docid_semantic(text)
  text
end

#xref_init(lang, script, _klass, labels, options) ⇒ Object



12
13
14
15
# File 'lib/isodoc/jis/init.rb', line 12

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