lib/review/tocprinter.rb in review-1.3.0 vs lib/review/tocprinter.rb in review-1.4.0
- old
+ new
@@ -124,12 +124,15 @@
else
html << chapter_to_s(chap)
end
end
end
+ layout_file = File.join(book.basedir, "layouts", "layout.html.erb")
+ unless File.exist?(layout_file) # backward compatibility
+ layout_file = File.join(book.basedir, "layouts", "layout.erb")
+ end
puts HTMLLayout.new(
- {'body' => html, 'title' => "目次"},
- File.join(book.basedir, "layouts", "layout.erb")).result
+ {'body' => html, 'title' => "目次"}, layout_file).result
end
private
def chap_sections_to_s(chap)