1
require 'rdoc/generator/html'
4
# Generate XML output as one big file
6
class RDoc::Generator::XML < RDoc::Generator::HTML
9
# Standard generator factory
20
# Build the initial indices and output objects
21
# based on an array of TopLevel objects containing
22
# the extracted information.
37
# * a list of File objects for each TopLevel object.
38
# * a list of Class objects for each first level
39
# class or module in the TopLevel objects
40
# * a complete list of all hyperlinkable terms (file,
41
# class, module, and method names)
44
@info.each do |toplevel|
45
@files << RDoc::Generator::File.new(toplevel, @options, RDoc::Generator::FILE_DIR)
48
RDoc::TopLevel.all_classes_and_modules.each do |cls|
49
build_class_list(cls, @files[0], RDoc::Generator::CLASS_DIR)
53
def build_class_list(from, html_file, class_dir)
54
@classes << RDoc::Generator::Class.new(from, html_file, class_dir, @options)
55
from.each_classmodule do |mod|
56
build_class_list(mod, html_file, class_dir)
61
# Generate all the HTML. For the one-file case, we generate
62
# all the information in to one big hash
66
'charset' => @options.charset,
67
'files' => gen_into(@files),
68
'classes' => gen_into(@classes)
71
template = RDoc::TemplatePage.new @template::ONE_PAGE
74
opfile = File.open(@options.op_name, "w")
78
template.write_html_on(opfile, values)
84
res << item.value_hash
90
gen_an_index(@files, 'Files')
94
gen_an_index(@classes, 'Classes')
98
gen_an_index(RDoc::Generator::HtmlMethod.all_methods, 'Methods')
101
def gen_an_index(collection, title)
103
collection.sort.each do |f|
105
res << { "href" => f.path, "name" => f.index_name }
111
'list_title' => title,
112
'index_url' => main_url,