require 'review/tocprinter' require 'review/i18n' module ReVIEW class WEBTOCPrinter < TOCPrinter include HTMLUtils def self.book_to_string(book) io = StringIO.new ReVIEW::WEBTOCPrinter.new(1, {}, io).print_book(book) io.seek(0) io.read end def print_book(book) @out.puts '' end def print_part(part) if part.number if part.file? ext = part.book.config['htmlext'] || 'html' path = File.basename(part.path.sub(/\.re/, '.' + ext)) @out.puts %Q(
  • #{h(I18n.t('part_short', part.number) + ' ' + part.title)}\n