module IsoDoc::Acme::BaseConvert

Public Instance Methods

annex_name(annex, name, div) click to toggle source
# File lib/isodoc/acme/base_convert.rb, line 17
def annex_name(annex, name, div)
  div.h1 **{ class: "Annex" } do |t|
    t << "#{anchor(annex['id'], :label)} "
    t.br
    t.b do |b|
      name&.children&.each { |c2| parse(c2, b) }
    end
  end
end
baselocation(loc) click to toggle source
# File lib/isodoc/acme/base_convert.rb, line 12
def baselocation(loc)
  return nil if loc.nil?
  File.expand_path(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
end
cleanup(docxml) click to toggle source
Calls superclass method
# File lib/isodoc/acme/base_convert.rb, line 35
def cleanup(docxml)
  super
  term_cleanup(docxml)
end
fileloc(loc) click to toggle source
# File lib/isodoc/acme/base_convert.rb, line 31
def fileloc(loc)
  File.join(File.dirname(__FILE__), loc)
end
i18n_init(lang, script) click to toggle source
Calls superclass method
# File lib/isodoc/acme/base_convert.rb, line 27
def i18n_init(lang, script)
  super
end
make_body(xml, docxml) click to toggle source
# File lib/isodoc/acme/base_convert.rb, line 49
def make_body(xml, docxml)
  body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
  xml.body **body_attr do |body|
    make_body1(body, docxml)
    make_body2(body, docxml)
    make_body3(body, docxml)
  end
end
metadata_init(lang, script, labels) click to toggle source
# File lib/isodoc/acme/base_convert.rb, line 8
def metadata_init(lang, script, labels)
  @meta = Metadata.new(lang, script, labels)
end
term_cleanup(docxml) click to toggle source
# File lib/isodoc/acme/base_convert.rb, line 40
def term_cleanup(docxml)
  docxml.xpath("//p[@class = 'Terms']").each do |d|
    h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
    h2.add_child("&nbsp;")
    h2.add_child(d.remove)
  end
  docxml
end