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



7
8
9
10
# File 'lib/isodoc/generic/base_convert.rb', line 7

def cleanup(docxml)
  super
  term_cleanup(docxml)
end

#info(isoxml, out) ⇒ Object



31
32
33
34
# File 'lib/isodoc/generic/base_convert.rb', line 31

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

#make_body(xml, docxml) ⇒ Object



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

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



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

def term_cleanup(docxml)
  docxml.xpath("//p[@class = 'Terms']").each do |d|
    h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
    d["id"] = h2["id"]
    d.add_first_child "<strong>#{to_xml(h2.remove.children)}</strong>&#xa0;"
  end
  docxml
end