diff options
Diffstat (limited to 'lib/rdoc/generator/html/kilmer.rb')
-rw-r--r-- | lib/rdoc/generator/html/kilmer.rb | 329 |
1 files changed, 31 insertions, 298 deletions
diff --git a/lib/rdoc/generator/html/kilmer.rb b/lib/rdoc/generator/html/kilmer.rb index 6479abaf8b..4c5a9ee8b0 100644 --- a/lib/rdoc/generator/html/kilmer.rb +++ b/lib/rdoc/generator/html/kilmer.rb @@ -1,10 +1,11 @@ require 'rdoc/generator/html' +require 'rdoc/generator/html/kilmerfactory' module RDoc::Generator::HTML::KILMER FONTS = "Verdana, Arial, Helvetica, sans-serif" - STYLE = <<-EOF + CENTRAL_STYLE = <<-EOF body,td,p { font-family: <%= values["fonts"] %>; color: #000040; } @@ -30,6 +31,10 @@ body,td,p { font-family: <%= values["fonts"] %>; .aqua { color: black } +#diagram img { + border: 0; +} + .method-name, .attr-name { font-family: font-family: <%= values["fonts"] %>; font-weight: bold; @@ -67,7 +72,7 @@ body,td,p { font-family: <%= values["fonts"] %>; font-weight: bold; text-decoration: none; color: #000033; - background-color: white; + background: #ccc; } .srclink { @@ -78,232 +83,8 @@ body,td,p { font-family: <%= values["fonts"] %>; background-color: white; } -.paramsig { - font-size: small; -} - .srcbut { float: right } - EOF - - BODY = <<-EOF -<html><head> - <title><%= values["title"] %></title> - <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>"> - <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" /> - <script type="text/javascript" language="JavaScript"> - <!-- - function popCode(url) { - parent.frames.source.location = url - } - //--> - </script> -</head> -<body bgcolor="white"> - -<%= template_include %> <!-- banner header --> - -<% if values["diagram"] then %> -<table width="100%"><tr><td align="center"> -<%= values["diagram"] %> -</td></tr></table> -<% end %> - -<% if values["description"] then %> -<div class="description"><%= values["description"] %></div> -<% end %> - -<% if values["requires"] then %> -<table cellpadding="5" width="100%"> -<tr><td class="tablesubtitle">Required files</td></tr> -</table><br /> -<div class="name-list"> -<% values["requires"].each do |requires| %> -<%= href requires["aref"], requires["name"] %> -<% end %><%# values["requires"] %> -<% end %> -</div> - -<% if values["methods"] then %> -<table cellpadding="5" width="100%"> -<tr><td class="tablesubtitle">Methods</td></tr> -</table><br /> -<div class="name-list"> -<% values["methods"].each do |methods| %> -<%= href methods["aref"], methods["name"] %>, -<% end %><%# values["methods"] %> -</div> -<% end %> - - -<% values["sections"].each do |sections| %> - <div id="section"> -<% if sections["sectitle"] then %> - <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2> -<% if sections["seccomment"] then %> - <div class="section-comment"> - <%= sections["seccomment"] %> - </div> -<% end %> -<% end %> - -<% if sections["attributes"] then %> -<table cellpadding="5" width="100%"> -<tr><td class="tablesubtitle">Attributes</td></tr> -</table><br /> -<table cellspacing="5"> -<% sections["attributes"].each do |attributes| %> - <tr valign="top"> -<% if attributes["rw"] then %> - <td align="center" class="attr-rw"> [<%= attributes["rw"] %>] </td> -<% end %> -<% unless attributes["rw"] then %> - <td></td> -<% end %> - <td class="attr-name"><%= attributes["name"] %></td> - <td><%= attributes["a_desc"] %></td> - </tr> -<% end %><%# sections["attributes"] %> -</table> -<% end %> - -<% if sections["classlist"] then %> -<table cellpadding="5" width="100%"> -<tr><td class="tablesubtitle">Classes and Modules</td></tr> -</table><br /> -<%= sections["classlist"] %><br /> -<% end %> - - <%= template_include %> <!-- method descriptions --> - -<% end %><%# values["sections"] %> - -</body> -</html> - EOF - - FILE_PAGE = <<-EOF -<table width="100%"> - <tr class="title-row"> - <td><table width="100%"><tr> - <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font><%= values["short_name"] %></td> - <td align="right"><table cellspacing="0" cellpadding="2"> - <tr> - <td class="small-title-font">Path:</td> - <td class="small-title-font"><%= values["full_path"] %> -<% if values["cvsurl"] then %> - (<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>) -<% end %> - </td> - </tr> - <tr> - <td class="small-title-font">Modified:</td> - <td class="small-title-font"><%= values["dtm_modified"] %></td> - </tr> - </table> - </td></tr></table></td> - </tr> -</table><br /> - EOF - - CLASS_PAGE = <<-EOF -<table width="100%" border="0" cellspacing="0"> - <tr class="title-row"> - <td class="big-title-font"> - <font size="-3"><b><%= values["classmod"] %></b><br /></font><%= values["full_name"] %> - </td> - <td align="right"> - <table cellspacing="0" cellpadding="2"> - <tr valign="top"> - <td class="small-title-font">In:</td> - <td class="small-title-font"> -<% values["infiles"].each do |infiles| %> -<%= href infiles["full_path_url"], infiles["full_path"] %> -<% if infiles["cvsurl"] then %> - (<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>) -<% end %> -<% end %><%# values["infiles"] %> - </td> - </tr> -<% if values["parent"] then %> - <tr> - <td class="small-title-font">Parent:</td> - <td class="small-title-font"> -<% if values["par_url"] then %> - <a href="<%= values["par_url"] %>" class="cyan"> -<% end %> -<%= values["parent"] %> -<% if values["par_url"] then %> - </a> -<% end %> - </td> - </tr> -<% end %> - </table> - </td> - </tr> -</table><br /> - EOF - METHOD_LIST = <<-EOF -<% if values["includes"] then %> -<div class="tablesubsubtitle">Included modules</div><br /> -<div class="name-list"> -<% values["includes"].each do |includes| %> - <span class="method-name"><%= href includes["aref"], includes["name"] %></span> -<% end %><%# values["includes"] %> -</div> -<% end %> - -<% if values["method_list"] then %> -<% values["method_list"].each do |method_list| $stderr.puts({ :method_list => method_list }.inspect) %> -<% if values["methods"] then %> -<table cellpadding=5 width="100%"> -<tr><td class="tablesubtitle"><%= values["type"] %> <%= values["category"] %> methods</td></tr> -</table> -<% values["methods"].each do |methods| $stderr.puts({ :methods => methods }.inspect) %> -<table width="100%" cellspacing="0" cellpadding="5" border="0"> -<tr><td class="methodtitle"> -<a name="<%= values["aref"] %>"> -<% if values["callseq"] then %> -<b><%= values["callseq"] %></b> -<% end %> -<% unless values["callseq"] then %> - <b><%= values["name"] %></b><%= values["params"] %> -<% end %> -<% if values["codeurl"] then %> -<a href="<%= values["codeurl"] %>" target="source" class="srclink">src</a> -<% end %> -</a></td></tr> -</table> -<% if values["m_desc"] then %> -<div class="description"> -<%= values["m_desc"] %> -</div> -<% end %> -<% if values["aka"] then %> -<div class="aka"> -This method is also aliased as -<% values["aka"].each do |aka| $stderr.puts({ :aka => aka }.inspect) %> -<a href="<%= values["aref"] %>"><%= values["name"] %></a> -<% end %><%# values["aka"] %> -</div> -<% end %> -<% if values["sourcecode"] then %> -<pre class="source"> -<%= values["sourcecode"] %> -</pre> -<% end %> -<% end %><%# values["methods"] %> -<% end %> -<% end %><%# values["method_list"] %> -<% end %> - EOF - - SRC_PAGE = <<-EOF -<html> -<head><title><%= values["title"] %></title> -<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>"> -<style type="text/css"> .ruby-comment { color: green; font-style: italic } .ruby-constant { color: #4433aa; font-weight: bold; } .ruby-identifier { color: #222222; } @@ -313,28 +94,9 @@ This method is also aliased as .ruby-operator { color: #111111; } .ruby-regexp { color: #662222; } .ruby-value { color: #662222; font-style: italic } - .kw { color: #3333FF; font-weight: bold } - .cmt { color: green; font-style: italic } - .str { color: #662222; font-style: italic } - .re { color: #662222; } -</style> -</head> -<body bgcolor="white"> -<pre><%= values["code"] %></pre> -</body> -</html> EOF - FR_INDEX_BODY = %{ -<%= template_include %> -} - - FILE_INDEX = <<-EOF -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>"> -<style> -<!-- + INDEX_STYLE = <<-EOF body { background-color: #ddddff; font-family: #{FONTS}; @@ -355,64 +117,35 @@ div.banner { text-align: center; width: 100%; } +EOF ---> -</style> -<base target="docwin"> -</head> -<body> -<div class="banner"><%= values["list_title"] %></div> -<% values["entries"].each do |entries| %> -<a href="<%= entries["href"] %>"><%= entries["name"] %></a><br /> -<% end %><%# values["entries"] %> -</body></html> - EOF + FACTORY = RDoc::Generator::HTML:: + KilmerFactory.new(:central_css => CENTRAL_STYLE, + :index_css => INDEX_STYLE) - CLASS_INDEX = FILE_INDEX - METHOD_INDEX = FILE_INDEX + STYLE = FACTORY.get_STYLE() - INDEX = <<-EOF -<html> -<head> - <title><%= values["title"] %></title> - <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>"> -</head> + METHOD_LIST = FACTORY.get_METHOD_LIST() + + BODY = FACTORY.get_BODY() + + FILE_PAGE = FACTORY.get_FILE_PAGE() -<frameset cols="20%,*"> - <frameset rows="15%,35%,50%"> - <frame src="fr_file_index.html" title="Files" name="Files"> - <frame src="fr_class_index.html" name="Classes"> - <frame src="fr_method_index.html" name="Methods"> - </frameset> -<% if values["inline_source"] then %> - <frame src="<%= values["initial_page"] %>" name="docwin"> -<% end %> -<% unless values["inline_source"] then %> - <frameset rows="80%,20%"> - <frame src="<%= values["initial_page"] %>" name="docwin"> - <frame src="blank.html" name="source"> - </frameset> -<% end %> - <noframes> - <body bgcolor="white"> - Click <a href="html/index.html">here</a> for a non-frames - version of this page. - </body> - </noframes> -</frameset> + CLASS_PAGE = FACTORY.get_CLASS_PAGE() -</html> - EOF + SRC_PAGE = FACTORY.get_SRC_PAGE() - # A blank page to use as a target - BLANK = %{ -<html><body bgcolor="white"></body></html> -} + FR_INDEX_BODY = FACTORY.get_FR_INDEX_BODY() - def write_extra_pages - template = TemplatePage.new(BLANK) - File.open("blank.html", "w") { |f| template.write_html_on(f, {}) } - end + FILE_INDEX = FACTORY.get_FILE_INDEX() -end + CLASS_INDEX = FACTORY.get_CLASS_INDEX() + METHOD_INDEX = FACTORY.get_METHOD_INDEX() + + INDEX = FACTORY.get_INDEX() + + def self.write_extra_pages(values) + FACTORY.write_extra_pages(values) + end +end |