lib/isodoc/gb/gbhtmlrender.rb in metanorma-gb-1.0.12 vs lib/isodoc/gb/gbhtmlrender.rb in metanorma-gb-1.1.0

- old
+ new

@@ -37,21 +37,12 @@ EXAMPLE_TBL_ATTR = { valign: "top", class: "example_label", style: "padding:2pt 2pt 2pt 2pt" }.freeze - def example_parse(node, out) - out.table **attr_code(id: node["id"], class: "example") do |t| - t.tr do |tr| - tr.td **EXAMPLE_TBL_ATTR do |td| - td << l10n(example_label(node) + ":") - end - tr.td **{ valign: "top", class: "example" } do |td| - node.children.each { |n| parse(n, td) } - end - end - end + def example_label(node) + l10n(super + ":") end def note_parse(node, out) @note = true out.table **attr_code(id: node["id"], class: "Note") do |t| @@ -132,15 +123,15 @@ end.join end def populate_template(docxml, format) meta = @meta.get.merge(@labels) - logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format) + logo = @common.format_logo(meta[:gbprefix], meta[:gbscope], format, @localdir) logofile = @meta.standard_logo(meta[:gbprefix]) docxml = termref_resolve(docxml) meta[:standard_agency_formatted] = - @common.format_agency(meta[:standard_agency], format) + @common.format_agency(meta[:standard_agency], format, @localdir) meta[:standard_logo] = logo template = Liquid::Template.parse(docxml) template.render(meta.map { |k, v| [k.to_s, v] }.to_h) end @@ -181,11 +172,11 @@ def annex_name(annex, name, div) div.h1 **{ class: "Annex" } do |t| t << "#{get_anchors[annex['id']][:label]}<br/><br/>" t.b do |b| - name&.children&.each { |c2| parse(c2, b) } - end + name&.children&.each { |c2| parse(c2, b) } + end end end def term_defs_boilerplate(div, source, term, preface) unless preface