Extended maintenance of Ruby versions 1.8.7 and 1.9.2 ended on July 31, 2014. Read more

In Files

  • rdoc/generators/html_generator.rb

Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

Generators::HTMLGenerator

Public Class Methods

for(options) click to toggle source

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

 
               # File rdoc/generators/html_generator.rb, line 1160
def HTMLGenerator.for(options)
  AllReferences::reset
  HtmlMethod::reset

  if options.all_one_file
    HTMLGeneratorInOne.new(options)
  else
    HTMLGenerator.new(options)
  end
end
            
gen_url(path, target) click to toggle source

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

 
               # File rdoc/generators/html_generator.rb, line 1138
def HTMLGenerator.gen_url(path, target)
  from          = File.dirname(path)
  to, to_file   = File.split(target)
  
  from = from.split("/")
  to   = to.split("/")
  
  while from.size > 0 and to.size > 0 and from[0] == to[0]
    from.shift
    to.shift
  end
  
  from.fill("..")
  from.concat(to)
  from << to_file
  File.join(*from)
end
            

Public Instance Methods

generate(toplevels) click to toggle source

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

 
               # File rdoc/generators/html_generator.rb, line 1189
def generate(toplevels)
  @toplevels  = toplevels
  @files      = []
  @classes    = []

  write_style_sheet
  gen_sub_directories()
  build_indices
  generate_html
end
            

Protected Instance Methods

initialize(options) click to toggle source

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

 
               # File rdoc/generators/html_generator.rb, line 1178
def initialize(options) #:not-new:
  @options    = options
  load_html_template
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus