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