lib/review/tocprinter.rb in review-1.0.0 vs lib/review/tocprinter.rb in review-1.1.0
- old
+ new
@@ -64,12 +64,14 @@
private
def print_children(node)
return unless print?(node.level + 1)
node.each_section_with_index do |section, idx|
- print_node idx+1, section
- print_children section
+ unless section.blank?
+ print_node idx+1, section
+ print_children section
+ end
end
end
def print_node(number, node)
if node.chapter?
@@ -122,10 +124,12 @@
else
html << chapter_to_s(chap)
end
end
end
- puts HTMLLayout.new(html, "目次", File.join(book.basedir, "layouts", "layout.erb")).result
+ puts HTMLLayout.new({ :body => html,
+ :title => "目次",
+ :template => File.join(book.basedir, "layouts", "layout.erb")}).result
end
private
def chap_sections_to_s(chap)