| Class | RDoc::Generator::HTMLInOne |
| In: |
generator/html.rb
|
| Parent: | RDoc::Generator::HTML |
Generate:
# File generator/html.rb, line 303
303: def build_indices
304: @files, @classes = RDoc::Generator::Context.build_indices(@toplevels,
305: @options)
306: end
# File generator/html.rb, line 353
353: def gen_an_index(collection, title)
354: res = []
355: collection.sort.each do |f|
356: if f.document_self
357: res << { "href" => f.path, "name" => f.index_name }
358: end
359: end
360:
361: return {
362: "entries" => res,
363: 'list_title' => title,
364: 'index_url' => main_url,
365: }
366: end
# File generator/html.rb, line 345
345: def gen_class_index
346: gen_an_index(@classes, 'Classes')
347: end
# File generator/html.rb, line 341
341: def gen_file_index
342: gen_an_index(@files, 'Files')
343: end
# File generator/html.rb, line 333
333: def gen_into(list)
334: res = []
335: list.each do |item|
336: res << item.value_hash
337: end
338: res
339: end
# File generator/html.rb, line 349
349: def gen_method_index
350: gen_an_index(RDoc::Generator::Method.all_methods, 'Methods')
351: end
Generate all the HTML. For the one-file case, we generate all the information in to one big hash
# File generator/html.rb, line 312
312: def generate_xml
313: values = {
314: 'charset' => @options.charset,
315: 'files' => gen_into(@files),
316: 'classes' => gen_into(@classes),
317: 'title' => CGI.escapeHTML(@options.title),
318: }
319:
320: # this method is defined in the template file
321: write_extra_pages if defined? write_extra_pages
322:
323: template = RDoc::TemplatePage.new @template::ONE_PAGE
324:
325: if @options.op_name
326: opfile = open @options.op_name, 'w'
327: else
328: opfile = $stdout
329: end
330: template.write_html_on(opfile, values)
331: end