Module: IsoDoc::Generic::BaseConvert

Included in:
HtmlConvert, PdfConvert, WordConvert
Defined in:
lib/isodoc/generic/base_convert.rb

Instance Method Summary collapse

Instance Method Details

#cleanup(docxml) ⇒ Object

def baselocation(loc)

  return nil if loc.nil?
  File.expand_path(File.join(
    File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
end


15
16
17
18
# File 'lib/isodoc/generic/base_convert.rb', line 15

def cleanup(docxml)
  super
  term_cleanup(docxml)
end

#info(isoxml, out) ⇒ Object



39
40
41
42
# File 'lib/isodoc/generic/base_convert.rb', line 39

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

#make_body(xml, docxml) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/isodoc/generic/base_convert.rb', line 29

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

#term_cleanup(docxml) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/isodoc/generic/base_convert.rb', line 20

def term_cleanup(docxml)
  docxml.xpath("//p[@class = 'Terms']").each do |d|
    h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
    h2.add_child(" ")
    h2.add_child(d.remove)
  end
  docxml
end