Class: Rpub::Epub::HtmlToc
Instance Attribute Summary
Attributes inherited from XmlFile
Instance Method Summary collapse
Methods inherited from XmlFile
Constructor Details
This class inherits a constructor from Rpub::XmlFile
Instance Method Details
#render ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rpub/epub/html_toc.rb', line 4 def render xml.div :id => 'toc' do xml.h1 'Table of Contents' xml.div :class => 'toc' do book.outline.each do |(filename, headings)| headings.each do |heading| if heading.level <= (book.config.max_level || 2) xml.div :class => "level-#{heading.level}" do xml.a heading.text, :href => [filename, heading.html_id].join('#') end end end end end end end |