Module: IsoDoc::Iec::BaseConvert

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

Instance Method Summary collapse

Instance Method Details

#biblio_list(elem, div, biblio) ⇒ Object



23
24
25
26
27
28
# File 'lib/isodoc/iec/base_convert.rb', line 23

def biblio_list(elem, div, biblio)
  @is_iev or return super
  elem.children.each do |b|
    parse(b, div) unless %w(fmt-title bibitem).include? b.name
  end
end

#bibliography(node, out) ⇒ Object



19
20
21
# File 'lib/isodoc/iec/base_convert.rb', line 19

def bibliography(node, out)
  @is_iev or return super
end

#boilerplate(node, out) ⇒ Object



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

def boilerplate(node, out)
  # processed in foreword instead
end

#clause_attrs(node) ⇒ Object



53
54
55
56
57
# File 'lib/isodoc/iec/base_convert.rb', line 53

def clause_attrs(node)
  ret = super
  node["type"] == "boilerplate_legal" and ret["class"] = "boilerplate_legal"
  ret
end

#foreword(clause, out) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/isodoc/iec/base_convert.rb', line 11

def foreword(clause, out)
  out.div **attr_code(id: clause["id"]) do |s|
    clause_name(nil, clause.at(ns("./fmt-title")), s,
                { class: "ForewordTitle" })
    clause.elements.each { |e| parse(e, s) unless e.name == "fmt-title" }
  end
end

#para_class(node) ⇒ Object



46
47
48
49
50
51
# File 'lib/isodoc/iec/base_convert.rb', line 46

def para_class(node)
  case node["class"]
  when "zzSTDTitle1", "zzSTDTitle2" then "zzSTDTitle1"
  else super
  end
end

#terms_parse(node, out) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/isodoc/iec/base_convert.rb', line 30

def terms_parse(node, out)
  @is_iev or return super
  page_break(out)
  out.div **attr_code(id: node["id"]) do |div|
    depth = clause_title_depth(node, nil)
    out.send "h#{depth}", class: "zzSTDTitle2" do |p|
      p.b do |b|
        node&.at(ns("./fmt-title"))&.children&.each { |c2| parse(c2, b) }
      end
    end
    node.children.reject { |c1| c1.name == "fmt-title" }.each do |c1|
      parse(c1, div)
    end
  end
end