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.
Show source
def gen_main_index
if @template.const_defined? :FRAMELESS then
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