Method: Metanorma::Collection::Sectionsplit#section_split_cover

Defined in:
lib/metanorma/collection/sectionsplit/sectionsplit.rb

#section_split_cover(col, ident, _one_doc_coll) ⇒ Object



204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/metanorma/collection/sectionsplit/sectionsplit.rb', line 204

def section_split_cover(col, ident, _one_doc_coll)
  dir = File.dirname(col.file)
  collection_setup(nil, dir)
  r = ::Metanorma::Collection::Renderer
    .new(col, dir, output_folder: "#{ident}_collection",
                   format: %i(html), coverpage: File.join(dir, "cover.html"))
  r.coverpage
  # filename = one_doc_coll ? "#{ident}_index.html" : "index.html"
  filename = File.basename("#{ident}_index.html") # ident can be a directory with YAML indirection
  FileUtils.mv File.join(r.outdir, "index.html"), File.join(dir, filename)
  FileUtils.rm_rf r.outdir
  filename
end