class ReVIEW::HTMLTOCPrinter

Public Instance Methods

print_book(book) click to toggle source
print_chapter(chap) click to toggle source
print_part(part) click to toggle source
Calls superclass method ReVIEW::TOCPrinter#print_part

Private Instance Methods

a_name(name, label) click to toggle source
# File lib/review/tocprinter.rb, line 142
def a_name(name, label)
  %Q(<a name="#{name}">#{label}</a>)
end
chap_sections_to_s(chap) click to toggle source
# File lib/review/tocprinter.rb, line 116
def chap_sections_to_s(chap)
  return '' if chap.section_size < 1
  res = []
  res << '<ol>'
  chap.each_section { |sec| res << li(escape_html(sec.label)) }
  res << '</ol>'
  res.join("\n")
end
chapter_to_s(chap) click to toggle source
# File lib/review/tocprinter.rb, line 125
def chapter_to_s(chap)
  res = []
  chap.each_section do |sec|
    res << li(escape_html(sec.label))
    next unless print?(4)
    next unless sec.section_size > 0
    res << '<ul>'
    sec.each_section { |node| res << li(escape_html(node.label)) }
    res << '</ul>'
  end
  res.join("\n")
end
li(content) click to toggle source
# File lib/review/tocprinter.rb, line 138
def li(content)
  "<li>#{content}</li>"
end