Class Generators::HTMLGenerator
In: generators/html_generator.rb
Parent: Object

Methods

for   gen_url   generate   new  

Included Modules

MarkUp

Public Class methods

Generators may need to return specific subclasses depending on the options they are passed. Because of this we create them using a factory

[Source]

      # File generators/html_generator.rb, line 1212
1212:     def HTMLGenerator.for(options)
1213:       AllReferences::reset
1214:       HtmlMethod::reset
1215: 
1216:       if options.all_one_file
1217:         HTMLGeneratorInOne.new(options)
1218:       else
1219:         HTMLGenerator.new(options)
1220:       end
1221:     end

convert a target url to one that is relative to a given path

[Source]

      # File generators/html_generator.rb, line 1190
1190:     def HTMLGenerator.gen_url(path, target)
1191:       from          = File.dirname(path)
1192:       to, to_file   = File.split(target)
1193:       
1194:       from = from.split("/")
1195:       to   = to.split("/")
1196:       
1197:       while from.size > 0 and to.size > 0 and from[0] == to[0]
1198:         from.shift
1199:         to.shift
1200:       end
1201:       
1202:       from.fill("..")
1203:       from.concat(to)
1204:       from << to_file
1205:       File.join(*from)
1206:     end

Set up a new HTML generator. Basically all we do here is load up the correct output temlate

[Source]

      # File generators/html_generator.rb, line 1230
1230:     def initialize(options) #:not-new:
1231:       @options    = options
1232:       load_html_template
1233:     end

Public Instance methods

Build the initial indices and output objects based on an array of TopLevel objects containing the extracted information.

[Source]

      # File generators/html_generator.rb, line 1241
1241:     def generate(toplevels)
1242:       @toplevels  = toplevels
1243:       @files      = []
1244:       @classes    = []
1245: 
1246:       write_style_sheet
1247:       gen_sub_directories()
1248:       build_indices
1249:       generate_html
1250:     end

[Validate]