Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_9_1_378) is shown here.
gen_main_index()private
The main index page is mostly a template frameset, but includes the initial page. If the --main option was given, we use this as our main page, otherwise we use the first file specified on the command line.
# File lib/rdoc/generator/html.rb, line 280
def gen_main_index
if @template.const_defined? :FRAMELESS then
#
# If we're using a template without frames, then just redirect
# to it from index.html.
#
# One alternative to this, expanding the main page's template into
# index.html, is tricky because the relative URLs will be different
# (since index.html is located in at the site's root,
# rather than within a files or a classes subdirectory).
#
open 'index.html', 'w' do |f|
f.puts(%{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">})
f.puts(%{<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">})
f.puts(%{<head>})
f.puts(%{<title>#{CGI.escapeHTML(@options.title)}</title>})
f.puts(%{<meta http-equiv="refresh" content="0; url=#{@main_url}" />})
f.puts(%{</head>})
f.puts(%{<body></body>})
f.puts(%{</html>})
end
else
main = RDoc::TemplatePage.new @template::INDEX
open 'index.html', 'w' do |f|
style_url = style_url '', @options.css
classes = @classes.sort.map { |klass| klass.value_hash }
values = {
'initial_page' => @main_url,
'style_url' => style_url('', @options.css),
'title' => CGI.escapeHTML(@options.title),
'charset' => @options.charset,
'classes' => classes,
}
values['inline_source'] = @options.inline_source
main.write_html_on f, values
end
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