lib/asciidoctor/csand/converter.rb in metanorma-csand-1.0.5 vs lib/asciidoctor/csand/converter.rb in metanorma-csand-1.0.6
- old
+ new
@@ -1,9 +1,10 @@
require "asciidoctor"
require "metanorma/csand/version"
-require "isodoc/csand/csandconvert"
+require "isodoc/csand/html_convert"
require "asciidoctor/standoc/converter"
+require "fileutils"
module Asciidoctor
module Csand
CSAND_NAMESPACE = "https://open.ribose.com/standards/csand"
@@ -33,10 +34,16 @@
def metadata_committee(node, xml)
xml.editorialgroup do |a|
a.committee node.attr("technical-committee"),
**attr_code(type: node.attr("technical-committee-type"))
+ i = 2
+ while node.attr("technical-committee_#{i}") do
+ a.committee node.attr("technical-committee_#{i}"),
+ **attr_code(type: node.attr("technical-committee-type_#{i}"))
+ i += 1
+ end
end
end
def title(node, xml)
["en"].each do |lang|
@@ -100,10 +107,10 @@
filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
gsub(%r{^.*/}, "")
File.open(filename, "w") { |f| f.write(ret) }
html_converter(node).convert filename unless node.attr("nodoc")
end
- @files_to_delete.each { |f| system "rm #{f}" }
+ @files_to_delete.each { |f| FileUtils.rm f }
ret
end
def validate(doc)
content_validate(doc)