summaryrefslogtreecommitdiff
path: root/lib/rdoc/generators
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/generators')
-rw-r--r--lib/rdoc/generators/chm_generator.rb2
-rw-r--r--lib/rdoc/generators/html_generator.rb37
-rw-r--r--lib/rdoc/generators/ri_generator.rb2
-rw-r--r--lib/rdoc/generators/xml_generator.rb12
4 files changed, 27 insertions, 26 deletions
diff --git a/lib/rdoc/generators/chm_generator.rb b/lib/rdoc/generators/chm_generator.rb
index e951b40496..b4a5167a5c 100644
--- a/lib/rdoc/generators/chm_generator.rb
+++ b/lib/rdoc/generators/chm_generator.rb
@@ -1,6 +1,6 @@
require 'rdoc/generators/html_generator'
-class Generators::CHMGenerator < Generators::HTMLGenerator
+class RDoc::Generators::CHMGenerator < RDoc::Generators::HTMLGenerator
HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb
index acc6ab259f..6ddea9b437 100644
--- a/lib/rdoc/generators/html_generator.rb
+++ b/lib/rdoc/generators/html_generator.rb
@@ -3,7 +3,7 @@ require 'fileutils'
require 'rdoc/generators'
require 'rdoc/markup/simple_markup/to_html'
-module Generators
+module RDoc::Generators
##
# Name of sub-direcory that holds file descriptions
@@ -59,13 +59,16 @@ module Generators
##
# We need to record the html path of our caller so we can generate
# correct relative paths for any hyperlinks that we find
- def initialize(from_path, context)
+ def initialize(from_path, context, options)
super()
+
@from_path = from_path
@parent_name = context.parent_name
@parent_name += "::" if @parent_name
@context = context
+
+ @options = options
end
##
@@ -80,7 +83,7 @@ module Generators
name = special.text
if name[0,1] == '#'
lookup = name[1..-1]
- name = lookup unless Options.instance.show_hash
+ name = lookup unless @options.show_hash
else
lookup = name
end
@@ -201,7 +204,7 @@ module Generators
end
unless defined? @html_formatter
- @html_formatter = HyperlinkHtml.new(self.path, self)
+ @html_formatter = HyperlinkHtml.new(self.path, self, @options)
end
# Convert leading comment markers to spaces, but only
@@ -615,9 +618,9 @@ module Generators
def write_on(f)
value_hash
- template = TemplatePage.new(RDoc::Page::BODY,
- RDoc::Page::CLASS_PAGE,
- RDoc::Page::METHOD_LIST)
+ template = RDoc::TemplatePage.new(RDoc::Page::BODY,
+ RDoc::Page::CLASS_PAGE,
+ RDoc::Page::METHOD_LIST)
template.write_html_on(f, @values)
end
@@ -847,9 +850,9 @@ module Generators
def write_on(f)
value_hash
- template = TemplatePage.new(RDoc::Page::BODY,
- RDoc::Page::FILE_PAGE,
- RDoc::Page::METHOD_LIST)
+ template = RDoc::TemplatePage.new(RDoc::Page::BODY,
+ RDoc::Page::FILE_PAGE,
+ RDoc::Page::METHOD_LIST)
template.write_html_on(f, @values)
end
@@ -878,8 +881,6 @@ module Generators
end
- ##
-
class HtmlMethod
include MarkUp
@@ -1014,7 +1015,7 @@ module Generators
FileUtils.mkdir_p(meth_path)
file_path = File.join(meth_path, @seq) + ".html"
- template = TemplatePage.new(RDoc::Page::SRC_PAGE)
+ template = RDoc::TemplatePage.new(RDoc::Page::SRC_PAGE)
File.open(file_path, "w") do |f|
values = {
'title' => CGI.escapeHTML(index_name),
@@ -1069,7 +1070,7 @@ module Generators
end
end
- add_line_numbers(src) if Options.instance.include_line_numbers
+ add_line_numbers(src) if @options.include_line_numbers
src
end
@@ -1239,7 +1240,7 @@ module Generators
# Write out the style sheet used by the main frames
def write_style_sheet
- template = TemplatePage.new(RDoc::Page::STYLE)
+ template = RDoc::TemplatePage.new(RDoc::Page::STYLE)
unless @options.css
File.open(CSS_NAME, "w") do |f|
values = { "fonts" => RDoc::Page::FONTS }
@@ -1333,7 +1334,7 @@ module Generators
end
def gen_an_index(collection, title, template, filename)
- template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
+ template = RDoc::TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
res = []
collection.sort.each do |f|
if f.document_self
@@ -1361,7 +1362,7 @@ module Generators
# line.
def gen_main_index
- template = TemplatePage.new(RDoc::Page::INDEX)
+ template = RDoc::TemplatePage.new(RDoc::Page::INDEX)
File.open("index.html", "w") do |f|
values = {
"initial_page" => main_url,
@@ -1473,7 +1474,7 @@ module Generators
# this method is defined in the template file
write_extra_pages if defined? write_extra_pages
- template = TemplatePage.new(RDoc::Page::ONE_PAGE)
+ template = RDoc::TemplatePage.new(RDoc::Page::ONE_PAGE)
if @options.op_name
opfile = File.open(@options.op_name, "w")
diff --git a/lib/rdoc/generators/ri_generator.rb b/lib/rdoc/generators/ri_generator.rb
index edca9938a5..48a66c0d73 100644
--- a/lib/rdoc/generators/ri_generator.rb
+++ b/lib/rdoc/generators/ri_generator.rb
@@ -6,7 +6,7 @@ require 'rdoc/ri/ri_reader'
require 'rdoc/ri/ri_writer'
require 'rdoc/ri/ri_descriptions'
-class Generators::RIGenerator
+class RDoc::Generators::RIGenerator
##
# Generators may need to return specific subclasses depending on the
diff --git a/lib/rdoc/generators/xml_generator.rb b/lib/rdoc/generators/xml_generator.rb
index 1a027d176c..fe772f9ef4 100644
--- a/lib/rdoc/generators/xml_generator.rb
+++ b/lib/rdoc/generators/xml_generator.rb
@@ -3,7 +3,7 @@ require 'rdoc/generators/html_generator'
##
# Generate XML output as one big file
-class Generators::XMLGenerator < Generators::HTMLGenerator
+class RDoc::Generators::XMLGenerator < RDoc::Generators::HTMLGenerator
##
# Standard generator factory
@@ -42,16 +42,16 @@ class Generators::XMLGenerator < Generators::HTMLGenerator
def build_indices
@info.each do |toplevel|
- @files << Generators::HtmlFile.new(toplevel, @options, Generators::FILE_DIR)
+ @files << RDoc::Generators::HtmlFile.new(toplevel, @options, RDoc::Generators::FILE_DIR)
end
RDoc::TopLevel.all_classes_and_modules.each do |cls|
- build_class_list(cls, @files[0], Generators::CLASS_DIR)
+ build_class_list(cls, @files[0], RDoc::Generators::CLASS_DIR)
end
end
def build_class_list(from, html_file, class_dir)
- @classes << Generators::HtmlClass.new(from, html_file, class_dir, @options)
+ @classes << RDoc::Generators::HtmlClass.new(from, html_file, class_dir, @options)
from.each_classmodule do |mod|
build_class_list(mod, html_file, class_dir)
end
@@ -71,7 +71,7 @@ class Generators::XMLGenerator < Generators::HTMLGenerator
# this method is defined in the template file
write_extra_pages if defined? write_extra_pages
- template = TemplatePage.new(RDoc::Page::ONE_PAGE)
+ template = RDoc::TemplatePage.new(RDoc::Page::ONE_PAGE)
if @options.op_name
opfile = File.open(@options.op_name, "w")
@@ -98,7 +98,7 @@ class Generators::XMLGenerator < Generators::HTMLGenerator
end
def gen_method_index
- gen_an_index(Generators::HtmlMethod.all_methods, 'Methods')
+ gen_an_index(RDoc::Generators::HtmlMethod.all_methods, 'Methods')
end
def gen_an_index(collection, title)