Class | Generators::XHTMLGenerator |
In: |
generators/xhtml_generator.rb
|
Parent: | HTMLGenerator |
# File generators/xhtml_generator.rb, line 258 258: def XHTMLGenerator.for(options) 259: AllReferences::reset 260: HtmlMethod::reset 261: 262: if options.all_one_file 263: XHTMLGeneratorInOne.new(options) 264: else 265: XHTMLGenerator.new(options) 266: end 267: end
# File generators/xhtml_generator.rb, line 255 255: def XHTMLGenerator.gen_url(path, target) 256: Generators::HTMLGenerator.gen_url(path, target) 257: end
# File generators/xhtml_generator.rb, line 286 286: def build_class_list(from, html_file, class_dir) 287: @classes << XHtmlClass.new(from, html_file, class_dir, @options) 288: from.each_classmodule do |mod| 289: build_class_list(mod, html_file, class_dir) 290: end 291: end
# File generators/xhtml_generator.rb, line 276 276: def build_indices 277: @toplevels.each do |toplevel| 278: @files << XHtmlFile.new(toplevel, @options, FILE_DIR) 279: end 280: 281: RDoc::TopLevel.all_classes_and_modules.each do |cls| 282: build_class_list(cls, @files[0], CLASS_DIR) 283: end 284: end
# File generators/xhtml_generator.rb, line 322 322: def copy_xsls 323: xsl_files = ["mathml.xsl", "pmathmlcss.xsl", "ctop.xsl", "pmathml.xsl"] 324: xsl_dir = "rdoc/generators/template/xhtml" 325: hit = 0 326: $LOAD_PATH.each{ |path| 327: hit = 0 328: xsl_files.each{ |file| 329: hit += 1 if File.exist?(File.join(path, xsl_dir, file)) 330: } 331: if hit >= 4 332: xsl_files.each{ |file| 333: File.copy(File.join(path, xsl_dir, file), "./") 334: } 335: break 336: else 337: hit = 0 338: end 339: } 340: if hit < 4 341: $stderr.puts "Couldn't find xsl files (#{xsl_files.join(', ')})\n" 342: exit 343: end 344: end
# File generators/xhtml_generator.rb, line 299 299: def gen_an_index(collection, title, template, filename) 300: template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template) 301: res = [] 302: collection.sort.each do |f| 303: if f.document_self 304: res << { "href" => f.path, "name" => f.index_name } 305: end 306: end 307: 308: values = { 309: "entries" => res, 310: 'list_title' => CGI.escapeHTML(title), 311: 'index_url' => main_url, 312: 'charset' => @options.charset, 313: 'style_url' => style_url('', @options.css), 314: 'mathml_xsl_url' => style_url('', "mathml.xsl"), 315: } 316: 317: File.open(filename, "w") do |f| 318: template.write_html_on(f, values) 319: end 320: end
# File generators/xhtml_generator.rb, line 293 293: def gen_method_index 294: gen_an_index(XHtmlMethod.all_methods, 'Methods', 295: RDoc::Page::METHOD_INDEX, 296: "fr_method_index.html") 297: end