summaryrefslogtreecommitdiff
path: root/trunk/lib/rdoc/generator/html/one_page_html.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:02:05 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:02:05 +0000
commit0dc342de848a642ecce8db697b8fecd83a63e117 (patch)
tree2b7ed4724aff1f86073e4740134bda9c4aac1a39 /trunk/lib/rdoc/generator/html/one_page_html.rb
parentef70cf7138ab8034b5b806f466e4b484b24f0f88 (diff)
added tag v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/lib/rdoc/generator/html/one_page_html.rb')
-rw-r--r--trunk/lib/rdoc/generator/html/one_page_html.rb121
1 files changed, 121 insertions, 0 deletions
diff --git a/trunk/lib/rdoc/generator/html/one_page_html.rb b/trunk/lib/rdoc/generator/html/one_page_html.rb
new file mode 100644
index 0000000000..c4dd95529d
--- /dev/null
+++ b/trunk/lib/rdoc/generator/html/one_page_html.rb
@@ -0,0 +1,121 @@
+require 'rdoc/generator/html'
+
+module RDoc::Generator::HTML::ONE_PAGE_HTML
+
+ CONTENTS_XML = <<-EOF
+<% if defined? classes and classes["description"] then %>
+<%= classes["description"] %>
+<% end %>
+
+<% if defined? files and files["requires"] then %>
+<h4>Requires:</h4>
+<ul>
+<% files["requires"].each do |requires| %>
+<% if requires["aref"] then %>
+<li><a href="<%= requires["aref"] %>"><%= requires["name"] %></a></li>
+<% end %>
+<% unless requires["aref"] then %>
+<li><%= requires["name"] %></li>
+<% end %>
+<% end %><%# files["requires"] %>
+</ul>
+<% end %>
+
+<% if defined? classes and classes["includes"] then %>
+<h4>Includes</h4>
+<ul>
+<% classes["includes"].each do |includes| %>
+<% if includes["aref"] then %>
+<li><a href="<%= includes["aref"] %>"><%= includes["name"] %></a></li>
+<% end %>
+<% unless includes["aref"] then %>
+<li><%= includes["name"] %></li>
+<% end %>
+<% end %><%# classes["includes"] %>
+</ul>
+<% end %>
+
+<% if defined? classes and classes["sections"] then %>
+<% classes["sections"].each do |sections| %>
+<% if sections["attributes"] then %>
+<h4>Attributes</h4>
+<table>
+<% sections["attributes"].each do |attributes| %>
+<tr><td><%= attributes["name"] %></td><td><%= attributes["rw"] %></td><td><%= attributes["a_desc"] %></td></tr>
+<% end %><%# sections["attributes"] %>
+</table>
+<% end %>
+
+<% if sections["method_list"] then %>
+<h3>Methods</h3>
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+<% method_list["methods"].each do |methods| %>
+<h4><%= methods["type"] %> <%= methods["category"] %> method:
+<% if methods["callseq"] then %>
+<a name="<%= methods["aref"] %>"><%= methods["callseq"] %></a>
+<% end %>
+<% unless methods["callseq"] then %>
+<a name="<%= methods["aref"] %>"><%= methods["name"] %><%= methods["params"] %></a></h4>
+<% end %>
+
+<% if methods["m_desc"] then %>
+<%= methods["m_desc"] %>
+<% end %>
+
+<% if methods["sourcecode"] then %>
+<blockquote><pre>
+<%= methods["sourcecode"] %>
+</pre></blockquote>
+<% end %>
+<% end %><%# method_list["methods"] %>
+<% end %>
+<% end %><%# sections["method_list"] %>
+<% end %>
+<% end %><%# classes["sections"] %>
+<% end %>
+ EOF
+
+ ONE_PAGE = %{
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title><%= values["title"] %></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+</head>
+<body>
+<% values["files"].each do |files| %>
+<h2>File: <%= files["short_name"] %></h2>
+<table>
+ <tr><td>Path:</td><td><%= files["full_path"] %></td></tr>
+ <tr><td>Modified:</td><td><%= files["dtm_modified"] %></td></tr>
+</table>
+} + CONTENTS_XML + %{
+<% end %><%# values["files"] %>
+
+<% if values["classes"] then %>
+<h2>Classes</h2>
+<% values["classes"].each do |classes| %>
+<% if classes["parent"] then %>
+<h3><%= classes["classmod"] %> <%= classes["full_name"] %> &lt; <%= href classes["par_url"], classes["parent"] %></h3>
+<% end %>
+<% unless classes["parent"] then %>
+<h3><%= classes["classmod"] %> <%= classes["full_name"] %></h3>
+<% end %>
+
+<% if classes["infiles"] then %>
+(in files
+<% classes["infiles"].each do |infiles| %>
+<%= href infiles["full_path_url"], infiles["full_path"] %>
+<% end %><%# classes["infiles"] %>
+)
+<% end %>
+} + CONTENTS_XML + %{
+<% end %><%# values["classes"] %>
+<% end %>
+</body>
+</html>
+}
+
+end
+