Generate:
a list of RDoc::Generator::File objects for each TopLevel object.
a list of RDoc::Generator::Class objects for each first level class or module in the TopLevel objects
a complete list of all hyperlinkable terms (file, class, module, and method names)
# File rdoc/generator/html.rb, line 411
def build_indices
@files, @classes = RDoc::Generator::Context.build_indices(@toplevels,
@options)
end
# File rdoc/generator/html.rb, line 438
def gen_into(list)
res = []
list.each do |item|
res << item.value_hash
end
res
end
Build the initial indices and output objects based on an array of TopLevel objects containing the extracted information.
# File rdoc/generator/html.rb, line 394
def generate(info)
@toplevels = info
@hyperlinks = {}
build_indices
generate_xml
end
Generate all the HTML. For the one-file case, we generate all the information in to one big hash
# File rdoc/generator/html.rb, line 420
def generate_xml
values = {
'charset' => @options.charset,
'files' => gen_into(@files),
'classes' => gen_into(@classes),
'title' => CGI.escapeHTML(@options.title),
}
template = RDoc::TemplatePage.new @template::ONE_PAGE
if @options.op_name
opfile = open @options.op_name, 'w'
else
opfile = $stdout
end
template.write_html_on(opfile, values)
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.