sdoc 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rdoc/generator/template/rails/_context.rhtml +161 -125
- data/lib/rdoc/generator/template/rails/resources/css/main.css +9 -0
- data/lib/rdoc/generator/template/sdoc/_context.rhtml +161 -125
- data/lib/rdoc/generator/template/sdoc/resources/css/main.css +9 -0
- data/lib/sdoc/generator.rb +11 -6
- data/sdoc.gemspec +1 -1
- metadata +3 -3
@@ -1,173 +1,209 @@
|
|
1
1
|
<div id="content">
|
2
|
-
|
2
|
+
<% unless (description = context.description).empty? %>
|
3
3
|
<div class="description">
|
4
|
-
|
4
|
+
<%= description %>
|
5
5
|
</div>
|
6
|
-
|
6
|
+
<% end %>
|
7
|
+
|
7
8
|
|
8
|
-
|
9
|
+
<% unless context.requires.empty? %>
|
10
|
+
<!-- File only: requires -->
|
9
11
|
<div class="sectiontitle">Required Files</div>
|
10
12
|
<ul>
|
11
|
-
|
13
|
+
<% context.requires.each do |req| %>
|
12
14
|
<li><%= h req.name %></li>
|
13
|
-
|
15
|
+
<% end %>
|
14
16
|
</ul>
|
15
|
-
|
17
|
+
<% end %>
|
18
|
+
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
<% sections = context.sections.select { |s| s.title }.sort_by{ |s| s.title.to_s } %>
|
21
|
+
<% unless sections.empty? then %>
|
22
|
+
<!-- Sections -->
|
23
|
+
<div class="sectiontitle">Sections</div>
|
20
24
|
<ul>
|
21
|
-
|
22
|
-
<li><a href="#<%= section.
|
23
|
-
|
25
|
+
<% sections.each do |section| %>
|
26
|
+
<li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
|
27
|
+
<% end %>
|
24
28
|
</ul>
|
25
|
-
|
29
|
+
<% end %>
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
|
32
|
+
<% unless context.classes_and_modules.empty? %>
|
33
|
+
<!-- Namespace -->
|
34
|
+
<div class="sectiontitle">Namespace</div>
|
35
|
+
<ul>
|
36
|
+
<% (context.modules.sort + context.classes.sort).each do |mod| %>
|
37
|
+
<li>
|
38
|
+
<span class="type"><%= mod.type.upcase %></span>
|
39
|
+
<a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a>
|
40
|
+
</li>
|
41
|
+
<% end %>
|
42
|
+
</ul>
|
43
|
+
<% end %>
|
44
|
+
|
45
|
+
|
46
|
+
<% unless context.method_list.empty? %>
|
47
|
+
<!-- Method ref -->
|
32
48
|
<div class="sectiontitle">Methods</div>
|
33
49
|
<dl class="methods">
|
34
|
-
|
50
|
+
<% each_letter_group(context.method_list) do |group| %>
|
35
51
|
<dt><%= group[:name] %></dt>
|
36
52
|
<dd>
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
53
|
+
<ul>
|
54
|
+
<% group[:methods].each_with_index do |method, i| %>
|
55
|
+
<%
|
56
|
+
comma = group[:methods].size == i+1 ? '' : ','
|
57
|
+
%>
|
58
|
+
<li>
|
59
|
+
<a href="#<%= method.aref %>"><%= h method.name %></a><%= comma %>
|
60
|
+
</li>
|
61
|
+
<% end %>
|
62
|
+
</ul>
|
42
63
|
</dd>
|
43
|
-
|
64
|
+
<% end %>
|
44
65
|
</dl>
|
45
|
-
|
66
|
+
<% end %>
|
46
67
|
|
47
|
-
|
68
|
+
<% unless context.includes.empty? %>
|
69
|
+
<!-- Includes -->
|
48
70
|
<div class="sectiontitle">Included Modules</div>
|
49
71
|
<ul>
|
50
|
-
|
72
|
+
<% context.includes.each do |inc| %>
|
51
73
|
<li>
|
52
|
-
|
53
|
-
<a href="<%= context.aref_to inc.module.path %>"
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
74
|
+
<% unless String === inc.module %>
|
75
|
+
<a href="<%= context.aref_to inc.module.path %>">
|
76
|
+
<%= h inc.module.full_name %>
|
77
|
+
</a>
|
78
|
+
<% else %>
|
79
|
+
<%= h inc.name %>
|
80
|
+
<% end %>
|
58
81
|
</li>
|
59
|
-
|
82
|
+
<% end %>
|
60
83
|
</ul>
|
61
|
-
|
84
|
+
<% end %>
|
62
85
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
86
|
+
|
87
|
+
|
88
|
+
<% context.each_section do |section, constants, attributes| %>
|
89
|
+
|
90
|
+
<% if section.title then %>
|
91
|
+
<div class="contenttitle" id="<%= h section.aref %>">
|
92
|
+
<%= h section.title %>
|
93
|
+
</div>
|
70
94
|
<% end %>
|
71
95
|
|
72
|
-
<%
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
<li><span class="type"><%= mod.type.upcase %></span> <a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a></li>
|
77
|
-
<% end %>
|
78
|
-
</ul>
|
96
|
+
<% if section.comment then %>
|
97
|
+
<div class="description">
|
98
|
+
<%= section.description %>
|
99
|
+
</div>
|
79
100
|
<% end %>
|
80
101
|
|
81
|
-
<% unless
|
82
|
-
|
83
|
-
|
102
|
+
<% unless constants.empty? %>
|
103
|
+
<!-- Section constants -->
|
104
|
+
<div class="sectiontitle">Constants</div>
|
105
|
+
<table border='0' cellpadding='5'>
|
84
106
|
<% context.each_constant do |const| %>
|
85
|
-
|
107
|
+
<tr valign='top'>
|
86
108
|
<td class="attr-name"><%= h const.name %></td>
|
87
109
|
<td>=</td>
|
88
110
|
<td class="attr-value"><%= h const.value %></td>
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
111
|
+
</tr>
|
112
|
+
<% if const.comment %>
|
113
|
+
<tr valign='top'>
|
114
|
+
<td> </td>
|
115
|
+
<td colspan="2" class="attr-desc"><%= const.description.strip %></td>
|
116
|
+
</tr>
|
117
|
+
<% end %>
|
95
118
|
<% end %>
|
96
|
-
|
97
|
-
</table>
|
119
|
+
</table>
|
98
120
|
<% end %>
|
99
121
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
122
|
+
|
123
|
+
<% unless attributes.empty? %>
|
124
|
+
<!-- Section attributes -->
|
125
|
+
<div class="sectiontitle">Attributes</div>
|
126
|
+
<table border='0' cellpadding='5'>
|
127
|
+
<% attributes.each do |attrib| %>
|
128
|
+
<tr valign='top'>
|
105
129
|
<td class='attr-rw'>
|
106
|
-
|
130
|
+
[<%= attrib.rw %>]
|
107
131
|
</td>
|
108
132
|
<td class='attr-name'><%= h attrib.name %></td>
|
109
133
|
<td class='attr-desc'><%= attrib.description.strip %></td>
|
110
|
-
|
134
|
+
</tr>
|
111
135
|
<% end %>
|
112
|
-
|
136
|
+
</table>
|
113
137
|
<% end %>
|
114
138
|
|
115
|
-
|
139
|
+
|
140
|
+
<!-- Methods -->
|
141
|
+
<%
|
142
|
+
context.methods_by_type(section).each do |type, visibilities|
|
116
143
|
next if visibilities.empty?
|
144
|
+
|
117
145
|
visibilities.each do |visibility, methods|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
</
|
146
|
+
next if methods.empty?
|
147
|
+
%>
|
148
|
+
<div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
|
149
|
+
<% methods.each do |method| %>
|
150
|
+
<div class="method">
|
151
|
+
<div class="title method-title" id="<%= method.aref %>">
|
152
|
+
<% if method.call_seq %>
|
153
|
+
<a name="<%= method.aref %>"></a><b><%= method.call_seq.gsub(/->/, '→') %></b>
|
154
|
+
<% else %>
|
155
|
+
<a name="<%= method.aref %>"></a><b><%= h method.name %></b><%= h method.params %>
|
156
|
+
<% end %>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<% unless method.comment %>
|
160
|
+
<div class="description">
|
161
|
+
<%= method.description.strip %>
|
162
|
+
</div>
|
163
|
+
<% end %>
|
164
|
+
|
165
|
+
<% unless method.aliases.empty? %>
|
166
|
+
<div class="aka">
|
167
|
+
Also aliased as: <%= method.aliases.map do |aka|
|
168
|
+
if aka.parent then # HACK lib/rexml/encodings
|
169
|
+
%{<a href="#{context.aref_to aka.path}">#{h aka.name}</a>}
|
170
|
+
else
|
171
|
+
h aka.name
|
172
|
+
end
|
173
|
+
end.join ", " %>
|
174
|
+
</div>
|
175
|
+
<% end %>
|
176
|
+
|
177
|
+
<% if method.token_stream %>
|
178
|
+
<% markup = method.sdoc_markup_code %>
|
179
|
+
<div class="sourcecode">
|
180
|
+
<%
|
181
|
+
# generate github link
|
182
|
+
github = if options.github
|
183
|
+
if markup =~ /File\s(\S+), line (\d+)/
|
184
|
+
path = $1
|
185
|
+
line = $2.to_i
|
186
|
+
end
|
187
|
+
path && github_url(path)
|
188
|
+
else
|
189
|
+
false
|
190
|
+
end
|
191
|
+
%>
|
192
|
+
<p class="source-link">
|
193
|
+
Source:
|
194
|
+
<a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
|
195
|
+
<% if github %>
|
196
|
+
| <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
|
167
197
|
<% end %>
|
198
|
+
</p>
|
199
|
+
<div id="<%= method.aref %>_source" class="dyn-source">
|
200
|
+
<pre><%= markup %></pre>
|
201
|
+
</div>
|
168
202
|
</div>
|
169
|
-
<%
|
170
|
-
|
171
|
-
|
172
|
-
|
203
|
+
<% end %>
|
204
|
+
</div>
|
205
|
+
<% end #methods.each %>
|
206
|
+
<% end #visibilities.each %>
|
207
|
+
<% end #context.methods_by_type %>
|
208
|
+
<% end #context.each_section %>
|
173
209
|
</div>
|
@@ -200,6 +200,15 @@ pre
|
|
200
200
|
border-bottom: 1px solid #000;
|
201
201
|
}
|
202
202
|
|
203
|
+
.contenttitle {
|
204
|
+
margin-top: 4em;
|
205
|
+
margin-bottom: 1.3em;
|
206
|
+
margin-left: -0.9em;
|
207
|
+
font-size: 1.6em;
|
208
|
+
padding: 0 0 0.25em 0;
|
209
|
+
font-weight: bold;
|
210
|
+
}
|
211
|
+
|
203
212
|
.attr-rw {
|
204
213
|
padding-right: 1em;
|
205
214
|
text-align: center;
|
@@ -1,173 +1,209 @@
|
|
1
1
|
<div id="content">
|
2
|
-
|
2
|
+
<% unless (description = context.description).empty? %>
|
3
3
|
<div class="description">
|
4
|
-
|
4
|
+
<%= description %>
|
5
5
|
</div>
|
6
|
-
|
6
|
+
<% end %>
|
7
|
+
|
7
8
|
|
8
|
-
|
9
|
+
<% unless context.requires.empty? %>
|
10
|
+
<!-- File only: requires -->
|
9
11
|
<div class="sectiontitle">Required Files</div>
|
10
12
|
<ul>
|
11
|
-
|
13
|
+
<% context.requires.each do |req| %>
|
12
14
|
<li><%= h req.name %></li>
|
13
|
-
|
15
|
+
<% end %>
|
14
16
|
</ul>
|
15
|
-
|
17
|
+
<% end %>
|
18
|
+
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
<% sections = context.sections.select { |s| s.title }.sort_by{ |s| s.title.to_s } %>
|
21
|
+
<% unless sections.empty? then %>
|
22
|
+
<!-- Sections -->
|
23
|
+
<div class="sectiontitle">Sections</div>
|
20
24
|
<ul>
|
21
|
-
|
22
|
-
<li><a href="#<%= section.
|
23
|
-
|
25
|
+
<% sections.each do |section| %>
|
26
|
+
<li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
|
27
|
+
<% end %>
|
24
28
|
</ul>
|
25
|
-
|
29
|
+
<% end %>
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
|
32
|
+
<% unless context.classes_and_modules.empty? %>
|
33
|
+
<!-- Namespace -->
|
34
|
+
<div class="sectiontitle">Namespace</div>
|
35
|
+
<ul>
|
36
|
+
<% (context.modules.sort + context.classes.sort).each do |mod| %>
|
37
|
+
<li>
|
38
|
+
<span class="type"><%= mod.type.upcase %></span>
|
39
|
+
<a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a>
|
40
|
+
</li>
|
41
|
+
<% end %>
|
42
|
+
</ul>
|
43
|
+
<% end %>
|
44
|
+
|
45
|
+
|
46
|
+
<% unless context.method_list.empty? %>
|
47
|
+
<!-- Method ref -->
|
32
48
|
<div class="sectiontitle">Methods</div>
|
33
49
|
<dl class="methods">
|
34
|
-
|
50
|
+
<% each_letter_group(context.method_list) do |group| %>
|
35
51
|
<dt><%= group[:name] %></dt>
|
36
52
|
<dd>
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
53
|
+
<ul>
|
54
|
+
<% group[:methods].each_with_index do |method, i| %>
|
55
|
+
<%
|
56
|
+
comma = group[:methods].size == i+1 ? '' : ','
|
57
|
+
%>
|
58
|
+
<li>
|
59
|
+
<a href="#<%= method.aref %>"><%= h method.name %></a><%= comma %>
|
60
|
+
</li>
|
61
|
+
<% end %>
|
62
|
+
</ul>
|
42
63
|
</dd>
|
43
|
-
|
64
|
+
<% end %>
|
44
65
|
</dl>
|
45
|
-
|
66
|
+
<% end %>
|
46
67
|
|
47
|
-
|
68
|
+
<% unless context.includes.empty? %>
|
69
|
+
<!-- Includes -->
|
48
70
|
<div class="sectiontitle">Included Modules</div>
|
49
71
|
<ul>
|
50
|
-
|
72
|
+
<% context.includes.each do |inc| %>
|
51
73
|
<li>
|
52
|
-
|
53
|
-
<a href="<%= context.aref_to inc.module.path %>"
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
74
|
+
<% unless String === inc.module %>
|
75
|
+
<a href="<%= context.aref_to inc.module.path %>">
|
76
|
+
<%= h inc.module.full_name %>
|
77
|
+
</a>
|
78
|
+
<% else %>
|
79
|
+
<%= h inc.name %>
|
80
|
+
<% end %>
|
58
81
|
</li>
|
59
|
-
|
82
|
+
<% end %>
|
60
83
|
</ul>
|
61
|
-
|
84
|
+
<% end %>
|
62
85
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
86
|
+
|
87
|
+
|
88
|
+
<% context.each_section do |section, constants, attributes| %>
|
89
|
+
|
90
|
+
<% if section.title then %>
|
91
|
+
<div class="contenttitle" id="<%= h section.aref %>">
|
92
|
+
<%= h section.title %>
|
93
|
+
</div>
|
70
94
|
<% end %>
|
71
95
|
|
72
|
-
<%
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
<li><span class="type"><%= mod.type.upcase %></span> <a href="<%= context.aref_to mod.path %>"><%= mod.full_name %></a></li>
|
77
|
-
<% end %>
|
78
|
-
</ul>
|
96
|
+
<% if section.comment then %>
|
97
|
+
<div class="description">
|
98
|
+
<%= section.description %>
|
99
|
+
</div>
|
79
100
|
<% end %>
|
80
101
|
|
81
|
-
<% unless
|
82
|
-
|
83
|
-
|
102
|
+
<% unless constants.empty? %>
|
103
|
+
<!-- Section constants -->
|
104
|
+
<div class="sectiontitle">Constants</div>
|
105
|
+
<table border='0' cellpadding='5'>
|
84
106
|
<% context.each_constant do |const| %>
|
85
|
-
|
107
|
+
<tr valign='top'>
|
86
108
|
<td class="attr-name"><%= h const.name %></td>
|
87
109
|
<td>=</td>
|
88
110
|
<td class="attr-value"><%= h const.value %></td>
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
111
|
+
</tr>
|
112
|
+
<% if const.comment %>
|
113
|
+
<tr valign='top'>
|
114
|
+
<td> </td>
|
115
|
+
<td colspan="2" class="attr-desc"><%= const.description.strip %></td>
|
116
|
+
</tr>
|
117
|
+
<% end %>
|
95
118
|
<% end %>
|
96
|
-
|
97
|
-
</table>
|
119
|
+
</table>
|
98
120
|
<% end %>
|
99
121
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
122
|
+
|
123
|
+
<% unless attributes.empty? %>
|
124
|
+
<!-- Section attributes -->
|
125
|
+
<div class="sectiontitle">Attributes</div>
|
126
|
+
<table border='0' cellpadding='5'>
|
127
|
+
<% attributes.each do |attrib| %>
|
128
|
+
<tr valign='top'>
|
105
129
|
<td class='attr-rw'>
|
106
|
-
|
130
|
+
[<%= attrib.rw %>]
|
107
131
|
</td>
|
108
132
|
<td class='attr-name'><%= h attrib.name %></td>
|
109
133
|
<td class='attr-desc'><%= attrib.description.strip %></td>
|
110
|
-
|
134
|
+
</tr>
|
111
135
|
<% end %>
|
112
|
-
|
136
|
+
</table>
|
113
137
|
<% end %>
|
114
138
|
|
115
|
-
|
139
|
+
|
140
|
+
<!-- Methods -->
|
141
|
+
<%
|
142
|
+
context.methods_by_type(section).each do |type, visibilities|
|
116
143
|
next if visibilities.empty?
|
144
|
+
|
117
145
|
visibilities.each do |visibility, methods|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
</
|
146
|
+
next if methods.empty?
|
147
|
+
%>
|
148
|
+
<div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
|
149
|
+
<% methods.each do |method| %>
|
150
|
+
<div class="method">
|
151
|
+
<div class="title method-title" id="<%= method.aref %>">
|
152
|
+
<% if method.call_seq %>
|
153
|
+
<a name="<%= method.aref %>"></a><b><%= method.call_seq.gsub(/->/, '→') %></b>
|
154
|
+
<% else %>
|
155
|
+
<a name="<%= method.aref %>"></a><b><%= h method.name %></b><%= h method.params %>
|
156
|
+
<% end %>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<% unless method.comment %>
|
160
|
+
<div class="description">
|
161
|
+
<%= method.description.strip %>
|
162
|
+
</div>
|
163
|
+
<% end %>
|
164
|
+
|
165
|
+
<% unless method.aliases.empty? %>
|
166
|
+
<div class="aka">
|
167
|
+
Also aliased as: <%= method.aliases.map do |aka|
|
168
|
+
if aka.parent then # HACK lib/rexml/encodings
|
169
|
+
%{<a href="#{context.aref_to aka.path}">#{h aka.name}</a>}
|
170
|
+
else
|
171
|
+
h aka.name
|
172
|
+
end
|
173
|
+
end.join ", " %>
|
174
|
+
</div>
|
175
|
+
<% end %>
|
176
|
+
|
177
|
+
<% if method.token_stream %>
|
178
|
+
<% markup = method.sdoc_markup_code %>
|
179
|
+
<div class="sourcecode">
|
180
|
+
<%
|
181
|
+
# generate github link
|
182
|
+
github = if options.github
|
183
|
+
if markup =~ /File\s(\S+), line (\d+)/
|
184
|
+
path = $1
|
185
|
+
line = $2.to_i
|
186
|
+
end
|
187
|
+
path && github_url(path)
|
188
|
+
else
|
189
|
+
false
|
190
|
+
end
|
191
|
+
%>
|
192
|
+
<p class="source-link">
|
193
|
+
Source:
|
194
|
+
<a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
|
195
|
+
<% if github %>
|
196
|
+
| <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
|
167
197
|
<% end %>
|
198
|
+
</p>
|
199
|
+
<div id="<%= method.aref %>_source" class="dyn-source">
|
200
|
+
<pre><%= markup %></pre>
|
201
|
+
</div>
|
168
202
|
</div>
|
169
|
-
<%
|
170
|
-
|
171
|
-
|
172
|
-
|
203
|
+
<% end %>
|
204
|
+
</div>
|
205
|
+
<% end #methods.each %>
|
206
|
+
<% end #visibilities.each %>
|
207
|
+
<% end #context.methods_by_type %>
|
208
|
+
<% end #context.each_section %>
|
173
209
|
</div>
|
@@ -187,6 +187,15 @@ pre
|
|
187
187
|
border-bottom: 1px solid #000;
|
188
188
|
}
|
189
189
|
|
190
|
+
.contenttitle {
|
191
|
+
margin-top: 4em;
|
192
|
+
margin-bottom: 1.3em;
|
193
|
+
margin-left: -0.9em;
|
194
|
+
font-size: 1.6em;
|
195
|
+
padding: 0 0 0.25em 0;
|
196
|
+
font-weight: bold;
|
197
|
+
}
|
198
|
+
|
190
199
|
.attr-rw {
|
191
200
|
padding-right: 1em;
|
192
201
|
text-align: center;
|
data/lib/sdoc/generator.rb
CHANGED
@@ -214,14 +214,17 @@ class RDoc::Generator::SDoc
|
|
214
214
|
end
|
215
215
|
|
216
216
|
### Recursivly build class tree structure
|
217
|
-
def generate_class_tree_level(classes)
|
217
|
+
def generate_class_tree_level(classes, visited = {})
|
218
218
|
tree = []
|
219
|
-
classes.select
|
219
|
+
classes.select do |klass|
|
220
|
+
!visited[klass] && klass.with_documentation?
|
221
|
+
end.sort.each do |klass|
|
222
|
+
visited[klass] = true
|
220
223
|
item = [
|
221
224
|
klass.name,
|
222
225
|
klass.document_self_or_methods ? klass.path : '',
|
223
226
|
klass.module? ? '' : (klass.superclass ? " < #{String === klass.superclass ? klass.superclass : klass.superclass.full_name}" : ''),
|
224
|
-
generate_class_tree_level(klass.classes_and_modules)
|
227
|
+
generate_class_tree_level(klass.classes_and_modules, visited)
|
225
228
|
]
|
226
229
|
tree << item
|
227
230
|
end
|
@@ -259,6 +262,7 @@ class RDoc::Generator::SDoc
|
|
259
262
|
@files.select { |file|
|
260
263
|
file.document_self
|
261
264
|
}.sort.each do |file|
|
265
|
+
debug_msg " #{file.path}"
|
262
266
|
index[:searchIndex].push( search_string(file.name) )
|
263
267
|
index[:longSearchIndex].push( search_string(file.path) )
|
264
268
|
index[:info].push([
|
@@ -275,11 +279,11 @@ class RDoc::Generator::SDoc
|
|
275
279
|
### Add classes to search +index+ array
|
276
280
|
def add_class_search_index(index)
|
277
281
|
debug_msg " generating class search index"
|
278
|
-
|
279
|
-
@classes.select { |klass|
|
282
|
+
@classes.uniq.select { |klass|
|
280
283
|
klass.document_self_or_methods
|
281
284
|
}.sort.each do |klass|
|
282
285
|
modulename = klass.module? ? '' : (klass.superclass ? (String === klass.superclass ? klass.superclass : klass.superclass.full_name) : '')
|
286
|
+
debug_msg " #{klass.parent.full_name}::#{klass.name}"
|
283
287
|
index[:searchIndex].push( search_string(klass.name) )
|
284
288
|
index[:longSearchIndex].push( search_string(klass.parent.full_name) )
|
285
289
|
files = klass.in_files.map{ |file| file.absolute_name }
|
@@ -298,7 +302,7 @@ class RDoc::Generator::SDoc
|
|
298
302
|
def add_method_search_index(index)
|
299
303
|
debug_msg " generating method search index"
|
300
304
|
|
301
|
-
list = @classes.map do |klass|
|
305
|
+
list = @classes.uniq.map do |klass|
|
302
306
|
klass.method_list
|
303
307
|
end.flatten.sort do |a, b|
|
304
308
|
a.name == b.name ?
|
@@ -312,6 +316,7 @@ class RDoc::Generator::SDoc
|
|
312
316
|
end
|
313
317
|
|
314
318
|
list.each do |method|
|
319
|
+
debug_msg " #{method.full_name}"
|
315
320
|
index[:searchIndex].push( search_string(method.name) + '()' )
|
316
321
|
index[:longSearchIndex].push( search_string(method.parent.full_name) )
|
317
322
|
index[:info].push([
|
data/sdoc.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 9
|
10
|
+
version: 0.3.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Vladimir Kolesnikov
|