lib/asciidoctor/gb/converter.rb in metanorma-gb-1.0.1 vs lib/asciidoctor/gb/converter.rb in metanorma-gb-1.0.2
- old
+ new
@@ -30,27 +30,40 @@
validate(ret1)
ret1.root.add_namespace(nil, GB_NAMESPACE)
ret1
end
+ def gb_attributes(node)
+ {
+ standardlogoimg: node.attr("standard-logo-img"),
+ standardclassimg: node.attr("standard-class-img"),
+ standardissuerimg: node.attr("standard-issuer-img"),
+ titlefont: node.attr("title-font"),
+ }
+ end
+
+ def html_extract_attributes(node)
+ super.merge(gb_attributes(node))
+ end
+
+ def doc_extract_attributes(node)
+ super.merge(gb_attributes(node))
+ end
+
def html_converter(node)
node.nil? ? IsoDoc::Gb::HtmlConvert.new({}) :
- IsoDoc::Gb::HtmlConvert.new(
- html_extract_attributes(node).merge(titlefont:
- node.attr("title-font")))
+ IsoDoc::Gb::HtmlConvert.new(html_extract_attributes(node))
end
def html_compliant_converter(node)
node.nil? ? IsoDoc::Gb::HtmlConvert.new({}) :
IsoDoc::Gb::HtmlConvert.new(html_extract_attributes(node).
- merge(compliant: true,
- titlefont: node.attr("title-font")))
+ merge(compliant: true))
end
def doc_converter(node)
node.nil? ? IsoDoc::Gb::WordConvert.new({}) :
- IsoDoc::Gb::WordConvert.new(doc_extract_attributes(node).
- merge(titlefont: node.attr("title-font")))
+ IsoDoc::Gb::WordConvert.new(doc_extract_attributes(node))
end
def document(node)
init(node)
ret = makexml(node).to_xml(indent: 2)