Class Generators::XHTMLGenerator
In: generators/xhtml_generator.rb
Parent: HTMLGenerator

Methods

Public Class methods

[Source]

     # File generators/xhtml_generator.rb, line 271
271:     def XHTMLGenerator.for(options)
272:       AllReferences::reset
273:       HtmlMethod::reset
274: 
275:       if options.all_one_file
276:         XHTMLGeneratorInOne.new(options)
277:       else
278:         XHTMLGenerator.new(options)
279:       end
280:     end

[Source]

     # File generators/xhtml_generator.rb, line 268
268:     def XHTMLGenerator.gen_url(path, target)
269:       Generators::HTMLGenerator.gen_url(path, target)
270:     end

Public Instance methods

[Source]

     # File generators/xhtml_generator.rb, line 299
299:     def build_class_list(from, html_file, class_dir)
300:       @classes << XHtmlClass.new(from, html_file, class_dir, @options)
301:       from.each_classmodule do |mod|
302:         build_class_list(mod, html_file, class_dir)
303:       end
304:     end

[Source]

     # File generators/xhtml_generator.rb, line 289
289:     def build_indices
290:       @toplevels.each do |toplevel|
291:         @files << XHtmlFile.new(toplevel, @options, FILE_DIR)
292:       end
293: 
294:       RDoc::TopLevel.all_classes_and_modules.each do |cls|
295:         build_class_list(cls, @files[0], CLASS_DIR)
296:       end
297:     end

[Source]

     # File generators/xhtml_generator.rb, line 335
335:     def copy_xsls
336:       xsl_files = ["mathml.xsl", "pmathmlcss.xsl", "ctop.xsl", "pmathml.xsl"]
337:       xsl_dir = "rdoc/generators/template/xhtml"
338:       hit = 0
339:       $LOAD_PATH.each{ |path|
340:         hit = 0
341:         xsl_files.each{ |file|
342:           hit += 1 if File.exist?(File.join(path, xsl_dir, file))
343:         }
344:         if hit >= 4
345:           xsl_files.each{ |file|
346:             File.copy(File.join(path, xsl_dir, file), "./")
347:           }
348:           break
349:         else
350:           hit = 0
351:         end
352:       }
353:       if hit < 4
354:         $stderr.puts "Couldn't find xsl files (#{xsl_files.join(', ')})\n"
355:         exit
356:       end
357:     end

[Source]

     # File generators/xhtml_generator.rb, line 312
312:     def gen_an_index(collection, title, template, filename)
313:       template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
314:       res = []
315:       collection.sort.each do |f|
316:         if f.document_self
317:           res << { "href" => f.path, "name" => f.index_name }
318:         end
319:       end
320: 
321:       values = {
322:         "entries"         => res,
323:         'list_title'      => CGI.escapeHTML(title),
324:         'index_url'       => main_url,
325:         'charset'         => @options.charset,
326:         'style_url'       => style_url('', @options.css),
327:         'mathml_xsl_url'  => style_url('', "mathml.xsl"),
328:       }
329: 
330:       File.open(filename, "w") do |f|
331:         template.write_html_on(f, values)
332:       end
333:     end

[Source]

     # File generators/xhtml_generator.rb, line 306
306:     def gen_method_index
307:       gen_an_index(XHtmlMethod.all_methods, 'Methods', 
308:                    RDoc::Page::METHOD_INDEX,
309:                    "fr_method_index.html")
310:     end

[Source]

     # File generators/xhtml_generator.rb, line 282
282:     def generate(toplevels)
283:       super(toplevels)
284:       copy_xsls
285:     end

[Validate]