OSDN Git Service

ruby-1.9.1-rc1
[splhack/AndroidRuby.git] / lib / ruby-1.9.1-rc1 / lib / rdoc / generator / html / one_page_html.rb
1 require 'rdoc/generator/html'
2 require 'rdoc/generator/html/common'
3
4 module RDoc::Generator::HTML::ONE_PAGE_HTML
5
6   include RDoc::Generator::HTML::Common
7
8   CONTENTS_XML = <<-EOF
9 <% if defined? classes and classes["description"] then %>
10 <%= classes["description"] %>
11 <% end %>
12
13 <% if defined? files and files["requires"] then %>
14 <h4>Requires:</h4>
15 <ul>
16 <% files["requires"].each do |requires| %>
17 <% if requires["aref"] then %>
18 <li><a href="<%= requires["aref"] %>"><%= requires["name"] %></a></li>
19 <% end %>
20 <% unless requires["aref"] then %>
21 <li><%= requires["name"] %></li>
22 <% end %>
23 <% end %><%# files["requires"] %>
24 </ul>
25 <% end %>
26
27 <% if defined? classes and classes["includes"] then %>
28 <h4>Includes</h4>
29 <ul>
30 <% classes["includes"].each do |includes| %>
31 <% if includes["aref"] then %>
32 <li><a href="<%= includes["aref"] %>"><%= includes["name"] %></a></li>
33 <% end %>
34 <% unless includes["aref"] then %>
35 <li><%= includes["name"] %></li>
36 <% end %>
37 <% end %><%# classes["includes"] %>
38 </ul>
39 <% end %>
40
41 <% if defined? classes and classes["sections"] then %>
42 <% classes["sections"].each do |sections| %>
43 <% if sections["attributes"] then %>
44 <h4>Attributes</h4>
45 <table>
46 <% sections["attributes"].each do |attributes| %>
47 <tr><td><%= attributes["name"] %></td><td><%= attributes["rw"] %></td><td><%= attributes["a_desc"] %></td></tr>
48 <% end %><%# sections["attributes"] %>
49 </table>
50 <% end %>
51
52 <% if sections["method_list"] then %>
53 <h3>Methods</h3>
54 <% sections["method_list"].each do |method_list| %>
55 <% if method_list["methods"] then %>
56 <% method_list["methods"].each do |methods| %>
57 <h4><%= methods["type"] %> <%= methods["category"] %> method: 
58 <% if methods["callseq"] then %>
59 <a name="<%= methods["aref"] %>"><%= methods["callseq"] %></a>
60 <% end %>
61 <% unless methods["callseq"] then %>
62 <a name="<%= methods["aref"] %>"><%= methods["name"] %><%= methods["params"] %></a></h4>
63 <% end %>
64
65 <% if methods["m_desc"] then %>
66 <%= methods["m_desc"] %>
67 <% end %>
68
69 <% if methods["sourcecode"] then %>
70 <blockquote><pre>
71 <%= methods["sourcecode"] %>
72 </pre></blockquote>
73 <% end %>
74 <% end %><%# method_list["methods"] %>
75 <% end %>
76 <% end %><%# sections["method_list"] %>
77 <% end %>
78 <% end %><%# classes["sections"] %>
79 <% end %>
80   EOF
81
82   ONE_PAGE = XHTML_STRICT_PREAMBLE + HTML_ELEMENT + %{
83 <head>
84   <title><%= values["title"] %></title>
85   <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
86 </head>
87 <body>
88 <% values["files"].each do |files| %>
89 <h2>File: <a name="<%= files["href"] %>"><%= files["short_name"] %></a></h2>
90 <table>
91   <tr><td>Path:</td><td><%= files["full_path"] %></td></tr>
92   <tr><td>Modified:</td><td><%= files["dtm_modified"] %></td></tr>
93 </table>
94 } + CONTENTS_XML + %{
95 <% end %><%# values["files"] %>
96
97 <% if values["classes"] then %>
98 <h2>Classes</h2>
99 <% values["classes"].each do |classes| %>
100 <% if classes["parent"] then %>
101 <h3><%= classes["classmod"] %> <a name="<%= classes["href"] %>"><%= classes["full_name"] %></a> &lt; <%= href classes["par_url"], classes["parent"] %></h3>
102 <% end %>
103 <% unless classes["parent"] then %>
104 <h3><%= classes["classmod"] %> <%= classes["full_name"] %></h3>
105 <% end %>
106
107 <% if classes["infiles"] then %>
108 (in files
109 <% classes["infiles"].each do |infiles| %>
110 <%= href infiles["full_path_url"], infiles["full_path"] %>
111 <% end %><%# classes["infiles"] %>
112 )
113 <% end %>
114 } + CONTENTS_XML + %{
115 <% end %><%# values["classes"] %>
116 <% end %>
117 </body>
118 </html>
119 }
120
121 end
122