Class Index
- WebRI
- WebRI::Blackfish
- WebRI::Component
- WebRI::Generator
- WebRI::GeneratorOne
- WebRI::GitHub
- WebRI::Heirarchy
- WebRI::Highlight
- WebRI::Icons
- WebRI::JSONFile
- WebRI::Longfish
- WebRI::Metadata
- WebRI::Newfish
- WebRI::Oldfish
- WebRI::Onefish
- WebRI::Prettify
- WebRI::Redfish
- WebRI::RiService
- WebRI::Search
- WebRI::Search::FilesTree
- WebRI::Server
- WebRI::Subversion
- WebRI::Template
- WebRI::TimeDelta
- WebRI::Twofish
- RDoc
- RDoc::AnyMethod
- RDoc::ClassModule
- RDoc::Options
- RDoc::Parser
- RDoc::Parser::C
- RDoc::TopLevel
- Syckle
- Syckle::Plugins
- Syckle::Plugins::WebRI
- Object
- OpEsc
Twofish Template
The Twofish template is a two pane layout, providing a navigation pane on the left and a document pane to the right. The navigation pane presents a collapsable namespace tree which updates the document pane, an iframe, via targeted a href links.
Public Instance Methods
generate_html_tree(classes)
click to toggle source
generate html tree
# File lib/webri/generators/twofish/generator.rb, line 64 def generate_html_tree(classes) markup = ["<ul>"] classes = classes.sort{ |a,b| a.full_name <=> b.full_name } classes.each do |entry| path = entry.path #WebRI.entry_to_path(entry.full_name) markup << %[ <li class="trigger"> <img src="assets/icon/class.png" onClick="showBranch(this);"/> <a class="link" href="#{path}" target="main">#{entry.name}</a> ] markup << %[<div class="branch">] markup << %[<ul>] cmethods, imethods = *entry.method_list.partition{ |m| m.singleton } cmethods = cmethods.sort{ |a,b| a.name <=> b.name } cmethods.each do |method| path = method.path #entry.full_name + ".#{method.name}" #WebRI.entry_to_path(entry.full_name + ".#{method}") markup << %[ <li class="meta_leaf"> <a class="link" href="#{path}" target="main">#{method.name}</a> </li> ] end imethods = imethods.sort{ |a,b| a.name <=> b.name } imethods.each do |method| path = method.path #WebRI.entry_to_path(entry.full_name + "##{method}") markup << %[ <li class="leaf"> <a class="link" href="#{path}" target="main">#{method.name}</a> </li> ] end #entry.classes.sort{ |a,b| a[0].to_s <=> b[0].to_s }.each do |(name, subspace)| #subspaces.each do |name, subspace| markup << generate_html_tree(entry.classes_and_modules) if entry.classes #end markup << %[</ul>] #if entry.root? # markup << %[</div>] #else markup << %[</div>] markup << %[</li>] #end end markup << "</ul>" return markup.join("\n") end
Disabled; run with --debug to generate this.