Module: IsoDoc::Iec::BaseConvert
- Included in:
- HtmlConvert, WordConvert
- Defined in:
- lib/isodoc/iec/base_convert.rb
Instance Method Summary collapse
- #biblio_list(elem, div, biblio) ⇒ Object
- #bibliography(node, out) ⇒ Object
- #boilerplate(node, out) ⇒ Object
- #clause_attrs(node) ⇒ Object
- #foreword(sect, out) ⇒ Object
- #para_class(node) ⇒ Object
- #set_termdomain(termdomain) ⇒ Object
- #terms_parse(node, out) ⇒ Object
Instance Method Details
#biblio_list(elem, div, biblio) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/isodoc/iec/base_convert.rb', line 22 def biblio_list(elem, div, biblio) return super unless @is_iev elem.children.each do |b| parse(b, div) unless %w(title bibitem).include? b.name end end |
#bibliography(node, out) ⇒ Object
18 19 20 |
# File 'lib/isodoc/iec/base_convert.rb', line 18 def bibliography(node, out) return super unless @is_iev 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
58 59 60 61 62 |
# File 'lib/isodoc/iec/base_convert.rb', line 58 def clause_attrs(node) ret = super node["type"] == "boilerplate_legal" and ret["class"] = "boilerplate_legal" ret end |
#foreword(sect, out) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/isodoc/iec/base_convert.rb', line 11 def foreword(sect, out) out.div **attr_code(id: sect ? sect["id"] : "") do |s| s.h1(class: "ForewordTitle") { |h1| h1 << @i18n.foreword } sect&.elements&.each { |e| parse(e, s) unless e.name == "title" } end end |
#para_class(node) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/isodoc/iec/base_convert.rb', line 51 def para_class(node) case node["class"] when "zzSTDTitle1", "zzSTDTitle2" then "zzSTDTitle1" else super end end |
#set_termdomain(termdomain) ⇒ Object
47 48 49 |
# File 'lib/isodoc/iec/base_convert.rb', line 47 def set_termdomain(termdomain) return super unless @is_iev end |
#terms_parse(node, out) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/isodoc/iec/base_convert.rb', line 30 def terms_parse(node, out) return super unless @is_iev 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("./title"))&.children&.each { |c2| parse(c2, b) } end end node.children.reject { |c1| c1.name == "title" }.each do |c1| parse(c1, div) end end end |