lib/asciidoctor/ogc/cleanup.rb in metanorma-ogc-1.5.4.1 vs lib/asciidoctor/ogc/cleanup.rb in metanorma-ogc-1.5.5
- old
+ new
@@ -56,10 +56,13 @@
def bibdata_cleanup(xmldoc)
super
a = xmldoc.at("//bibdata/status/stage")
a.text == "published" and a.children = "approved"
+ doctype = xmldoc.at("//bibdata/ext/doctype")
+ doctype.text == "technical-paper" and
+ doctype.children = "white-paper"
end
def section_names_terms_cleanup(xml)
replace_title(xml, "//definitions[@type = 'symbols']", @i18n&.symbols)
replace_title(xml, "//definitions[@type = 'abbreviated_terms']",
@@ -169,19 +172,33 @@
def requirement_type(xmldoc)
xmldoc.xpath(REQRECPER).each do |r|
next unless r["type"]
- r["type"] = case r["type"]
- when "requirement", "recommendation", "permission"
- "general"
- when "requirements_class" then "class"
- when "conformance_test" then "verification"
- when "conformance_class" then "conformanceclass"
- when "abstract_test" then "abstracttest"
- else r["type"]
- end
+ requirement_type1(r)
end
+ end
+
+ def requirement_type1(reqt)
+ reqt["type"] = case reqt["type"]
+ when "requirement", "recommendation", "permission"
+ "general"
+ when "requirements_class" then "class"
+ when "conformance_test" then "verification"
+ when "conformance_class" then "conformanceclass"
+ when "abstract_test" then "abstracttest"
+ else reqt["type"]
+ end
+ end
+
+ def normref_cleanup(xmldoc)
+ r1 = xmldoc.at("//references[title[translate(text(), 'R', 'r') = "\
+ "'Normative references']]")
+ r2 = xmldoc.at("//references[title[text() = 'References']]")
+ if r1 && r2
+ r2["normative"] = false
+ end
+ super
end
end
end
end