| Class | Generators::XHTMLGenerator |
| In: |
generators/xhtml_generator.rb
|
| Parent: | HTMLGenerator |
# File generators/xhtml_generator.rb, line 300
300: def XHTMLGenerator.for(options)
301: AllReferences::reset
302: HtmlMethod::reset
303:
304: if options.all_one_file
305: XHTMLGeneratorInOne.new(options)
306: else
307: XHTMLGenerator.new(options)
308: end
309: end
# File generators/xhtml_generator.rb, line 297
297: def XHTMLGenerator.gen_url(path, target)
298: Generators::HTMLGenerator.gen_url(path, target)
299: end
# File generators/xhtml_generator.rb, line 328
328: def build_class_list(from, html_file, class_dir)
329: @classes << XHtmlClass.new(from, html_file, class_dir, @options)
330: from.each_classmodule do |mod|
331: build_class_list(mod, html_file, class_dir)
332: end
333: end
# File generators/xhtml_generator.rb, line 318
318: def build_indices
319: @toplevels.each do |toplevel|
320: @files << XHtmlFile.new(toplevel, @options, FILE_DIR)
321: end
322:
323: RDoc::TopLevel.all_classes_and_modules.each do |cls|
324: build_class_list(cls, @files[0], CLASS_DIR)
325: end
326: end
# File generators/xhtml_generator.rb, line 364
364: def copy_xsls
365: xsl_files = ["mathml.xsl", "pmathmlcss.xsl", "ctop.xsl", "pmathml.xsl"]
366: xsl_dir = "rdoc/generators/template/xhtml"
367: hit = 0
368: $LOAD_PATH.each{ |path|
369: hit = 0
370: xsl_files.each{ |file|
371: hit += 1 if File.exist?(File.join(path, xsl_dir, file))
372: }
373: if hit >= 4
374: xsl_files.each{ |file|
375: File.copy(File.join(path, xsl_dir, file), "./")
376: }
377: break
378: else
379: hit = 0
380: end
381: }
382: if hit < 4
383: $stderr.puts "Couldn't find xsl files (#{xsl_files.join(', ')})\n"
384: exit
385: end
386: end
# File generators/xhtml_generator.rb, line 341
341: def gen_an_index(collection, title, template, filename)
342: template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
343: res = []
344: collection.sort.each do |f|
345: if f.document_self
346: res << { "href" => f.path, "name" => f.index_name }
347: end
348: end
349:
350: values = {
351: "entries" => res,
352: 'list_title' => CGI.escapeHTML(title),
353: 'index_url' => main_url,
354: 'charset' => @options.charset,
355: 'style_url' => style_url('', @options.css),
356: 'mathml_xsl_url' => style_url('', "mathml.xsl"),
357: }
358:
359: File.open(filename, "w") do |f|
360: template.write_html_on(f, values)
361: end
362: end
# File generators/xhtml_generator.rb, line 335
335: def gen_method_index
336: gen_an_index(XHtmlMethod.all_methods, 'Methods',
337: RDoc::Page::METHOD_INDEX,
338: "fr_method_index.html")
339: end