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

Methods

Public Class methods

[Source]

     # File generators/xhtml_generator.rb, line 235
235:     def XHTMLGenerator.for(options)
236:       AllReferences::reset
237:       HtmlMethod::reset
238: 
239:       if options.all_one_file
240:         XHTMLGeneratorInOne.new(options)
241:       else
242:         XHTMLGenerator.new(options)
243:       end
244:     end

[Source]

     # File generators/xhtml_generator.rb, line 232
232:     def XHTMLGenerator.gen_url(path, target)
233:       Generators::HTMLGenerator.gen_url(path, target)
234:     end

Public Instance methods

[Source]

     # File generators/xhtml_generator.rb, line 263
263:     def build_class_list(from, html_file, class_dir)
264:       @classes << XHtmlClass.new(from, html_file, class_dir, @options)
265:       from.each_classmodule do |mod|
266:         build_class_list(mod, html_file, class_dir)
267:       end
268:     end

[Source]

     # File generators/xhtml_generator.rb, line 253
253:     def build_indices
254:       @toplevels.each do |toplevel|
255:         @files << XHtmlFile.new(toplevel, @options, FILE_DIR)
256:       end
257: 
258:       RDoc::TopLevel.all_classes_and_modules.each do |cls|
259:         build_class_list(cls, @files[0], CLASS_DIR)
260:       end
261:     end

[Source]

     # File generators/xhtml_generator.rb, line 299
299:     def copy_xsls
300:       xsl_files = ["mathml.xsl", "pmathmlcss.xsl", "ctop.xsl", "pmathml.xsl"]
301:       xsl_dir = "rdoc/generators/template/xhtml"
302:       hit = 0
303:       $LOAD_PATH.each{ |path|
304:         hit = 0
305:         xsl_files.each{ |file|
306:           hit += 1 if File.exist?(File.join(path, xsl_dir, file))
307:         }
308:         if hit >= 4
309:           xsl_files.each{ |file|
310:             File.copy(File.join(path, xsl_dir, file), "./")
311:           }
312:           break
313:         else
314:           hit = 0
315:         end
316:       }
317:       if hit < 4
318:         $stderr.puts "Couldn't find xsl files (#{xsl_files.join(', ')})\n"
319:         exit
320:       end
321:     end

[Source]

     # File generators/xhtml_generator.rb, line 276
276:     def gen_an_index(collection, title, template, filename)
277:       template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
278:       res = []
279:       collection.sort.each do |f|
280:         if f.document_self
281:           res << { "href" => f.path, "name" => f.index_name }
282:         end
283:       end
284: 
285:       values = {
286:         "entries"         => res,
287:         'list_title'      => CGI.escapeHTML(title),
288:         'index_url'       => main_url,
289:         'charset'         => @options.charset,
290:         'style_url'       => style_url('', @options.css),
291:         'mathml_xsl_url'  => style_url('', "mathml.xsl"),
292:       }
293: 
294:       File.open(filename, "w") do |f|
295:         template.write_html_on(f, values)
296:       end
297:     end

[Source]

     # File generators/xhtml_generator.rb, line 270
270:     def gen_method_index
271:       gen_an_index(XHtmlMethod.all_methods, 'Methods', 
272:                    RDoc::Page::METHOD_INDEX,
273:                    "fr_method_index.html")
274:     end

[Source]

     # File generators/xhtml_generator.rb, line 246
246:     def generate(toplevels)
247:       super(toplevels)
248:       copy_xsls
249:     end

[Validate]