method
load_html_template
v1_9_1_378 -
Show latest stable
- Class:
RDoc::Generator::HTML
load_html_template()private
Load up the HTML template specified in the options. If the template name contains a slash, use it literally
# File lib/rdoc/generator/html.rb, line 95
def load_html_template
#
# If the template is not a path, first look for it
# in rdoc's HTML template directory. Perhaps this behavior should
# be reversed (first try to include the template and, only if that
# fails, try to include it in the default template directory).
# One danger with reversing the behavior, however, is that
# if something like require 'html' could load up an
# unrelated file in the standard library or in a gem.
#
template = @options.template
unless template =~ %{/|\\} then
template = File.join('rdoc', 'generator', @options.generator.key,
template)
end
begin
require template
@template = self.class.const_get @options.template.upcase
@options.template_class = @template
rescue LoadError => e
#
# The template did not exist in the default template directory, so
# see if require can find the template elsewhere (in a gem, for
# instance).
#
if(e.message[template] && template != @options.template)
template = @options.template
retry
end
$stderr.puts "Could not find HTML template '#{template}': #{e.message}"
exit 99
end
end Related methods
- Instance methods
- generate
- Class methods
- for
- new
- Private methods
-
build_indices -
gen_an_index -
gen_class_index -
gen_file_index -
gen_into -
gen_main_index -
gen_method_index -
gen_sub_directories -
generate_html -
index_to_links -
load_html_template -
main_url -
write_style_sheet