Module: IsoDoc::JIS::BaseConvert

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

Instance Method Summary collapse

Instance Method Details

#admonition_name_parse(_node, div, name) ⇒ Object



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

def admonition_name_parse(_node, div, name)
  div.span class: "note_label" do |s|
    name.children.each { |n| parse(n, s) }
    s << " &#x2014; "
  end
end

#annex(node, out) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/isodoc/jis/base_convert.rb', line 34

def annex(node, out)
  node["commentary"] = "true" and return commentary(node, out)
  amd?(isoxml) and @suppressheadingnumbers = @oldsuppressheadingnumbers
  page_break(out)
  out.div **attr_code(annex_attrs(node)) do |s|
    node.elements.each do |c1|
      if c1.name == "title" then annex_name(node, c1, s)
      else parse(c1, s) end
    end
  end
  amd?(isoxml) and @suppressheadingnumbers = true
end

#commentary(node, out) ⇒ Object



47
48
49
50
51
52
53
54
55
56
# File 'lib/isodoc/jis/base_convert.rb', line 47

def commentary(node, out)
  page_break(out)
  out.div **attr_code(annex_attrs(node)) do |s|
    node.elements.each do |c1|
      if c1.name == "title" then annex_name(node, c1, s)
      else parse(c1, s)
      end
    end
  end
end

#make_tr_attr(cell, row, totalrows, header, bordered) ⇒ Object



29
30
31
32
# File 'lib/isodoc/jis/base_convert.rb', line 29

def make_tr_attr(cell, row, totalrows, header, bordered)
  cell["border"] == "0" and bordered = false
  super
end

#termnote_parse(node, out) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/isodoc/jis/base_convert.rb', line 7

def termnote_parse(node, out)
  name = node.at(ns("./name"))&.remove
  out.div **note_attrs(node) do |div|
    div.p do |p|
      if name
        p.span class: "note_label" do |s|
          name.children.each { |n| parse(n, s) }
        end
        p << termnote_delim
      end
      para_then_remainder(node.first_element_child, node, p, div)
    end
  end
end