lib/metanorma/sectionsplit.rb in metanorma-1.6.3 vs lib/metanorma/sectionsplit.rb in metanorma-1.6.4

- old
+ new

@@ -107,11 +107,12 @@ def sectionsplit_preprocess_semxml(file, filename) xml = Nokogiri::XML(file, &:huge) type = xml.root.name.sub("-standard", "").to_sym @fileslookup&.parent&.update_xrefs(xml, @ident, {}) xml1 = Tempfile.open([filename, ".xml"], encoding: "utf-8") do |f| - f.write(@isodoc.to_xml(svg_preprocess(xml))) + #f.write(@isodoc.to_xml(svg_preprocess(xml))) + f.write(@isodoc.to_xml((xml))) f end @filecache ||= [] @filecache << xml1 [xml1.path, type] @@ -182,19 +183,19 @@ }, } Util::recursive_string_keys(ret).to_yaml end - def section_split_cover(col, ident) + def section_split_cover(col, ident, one_doc_coll) dir = File.dirname(col.file) collection_setup(nil, dir) CollectionRenderer.new(col, dir, output_folder: "#{ident}_collection", format: %i(html), coverpage: File.join(dir, "cover.html")).coverpage - FileUtils.mv "#{ident}_collection/index.html", - File.join(dir, "#{ident}_index.html") + filename = one_doc_coll ? "#{ident}_index.html" : "index.html" + FileUtils.mv "#{ident}_collection/index.html", File.join(dir, filename) FileUtils.rm_rf "#{ident}_collection" - "#{ident}_index.html" + filename end end end