~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/rdoc/generator/html/one_page_html.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-05-16 12:37:06 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20080516123706-r4llcdfd35aobrjv
Tags: 1.9.0.1-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.
* debian/control:
  - ruby1.9 pkg: moved rdoc1.9 suggestion to depends. (LP: #228345)

Show diffs side-by-side

added added

removed removed

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