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

Methods

Public Class methods

[Source]

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

[Source]

     # File generators/xhtml_generator.rb, line 229
229:     def XHTMLGenerator.gen_url(path, target)
230:       Generators::HTMLGenerator.gen_url(path, target)
231:     end

Public Instance methods

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

     # File generators/xhtml_generator.rb, line 243
243:     def generate(toplevels)
244:       super(toplevels)
245:       copy_xsls
246:     end

[Validate]