voloko-sdoc 0.2.9 → 0.2.10
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/VERSION.yml
CHANGED
data/lib/sdoc/generator/shtml.rb
CHANGED
@@ -21,8 +21,12 @@ require 'sdoc/templatable'
|
|
21
21
|
require 'sdoc/helpers'
|
22
22
|
|
23
23
|
class RDoc::ClassModule
|
24
|
+
def document_self_or_methods
|
25
|
+
document_self || method_list.any?{ |m| m.document_self }
|
26
|
+
end
|
27
|
+
|
24
28
|
def with_documentation?
|
25
|
-
|
29
|
+
document_self_or_methods || classes_and_modules.any?{ |c| c.with_documentation? }
|
26
30
|
end
|
27
31
|
end
|
28
32
|
|
@@ -127,7 +131,7 @@ class RDoc::Generator::SHtml
|
|
127
131
|
classes.select{|c| c.with_documentation? }.sort.each do |klass|
|
128
132
|
item = [
|
129
133
|
klass.name,
|
130
|
-
klass.
|
134
|
+
klass.document_self_or_methods ? klass.path : '',
|
131
135
|
klass.module? ? '' : (klass.superclass ? " < #{String === klass.superclass ? klass.superclass : klass.superclass.full_name}" : ''),
|
132
136
|
generate_class_tree_level(klass.classes_and_modules)
|
133
137
|
]
|
@@ -164,8 +168,8 @@ class RDoc::Generator::SHtml
|
|
164
168
|
def add_file_search_index(index)
|
165
169
|
debug_msg " generating file search index"
|
166
170
|
|
167
|
-
@files.select { |
|
168
|
-
|
171
|
+
@files.select { |file|
|
172
|
+
file.document_self
|
169
173
|
}.sort.each do |file|
|
170
174
|
index[:searchIndex].push( search_string(file.name) )
|
171
175
|
index[:longSearchIndex].push( search_string(file.path) )
|
@@ -184,8 +188,8 @@ class RDoc::Generator::SHtml
|
|
184
188
|
def add_class_search_index(index)
|
185
189
|
debug_msg " generating class search index"
|
186
190
|
|
187
|
-
@classes.select { |
|
188
|
-
|
191
|
+
@classes.select { |klass|
|
192
|
+
klass.document_self_or_methods
|
189
193
|
}.sort.each do |klass|
|
190
194
|
index[:searchIndex].push( search_string(klass.name) )
|
191
195
|
index[:longSearchIndex].push( search_string(klass.parent.name) )
|
@@ -205,7 +209,7 @@ class RDoc::Generator::SHtml
|
|
205
209
|
debug_msg " generating method search index"
|
206
210
|
|
207
211
|
list = @classes.map { |klass|
|
208
|
-
klass.method_list
|
212
|
+
klass.method_list
|
209
213
|
}.flatten.sort{ |a, b| a.name == b.name ? a.parent.full_name <=> b.parent.full_name : a.name <=> b.name }.select { |method|
|
210
214
|
method.document_self
|
211
215
|
}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<div id="content">
|
2
2
|
<% unless (desc = context.description).empty? %>
|
3
|
-
<div class="description"
|
3
|
+
<div class="description">
|
4
|
+
<%= desc %>
|
5
|
+
</div>
|
4
6
|
<% end %>
|
5
7
|
|
6
8
|
<% unless context.requires.empty? %>
|
@@ -116,7 +118,7 @@
|
|
116
118
|
next if visibilities.empty?
|
117
119
|
visibilities.each do |visibility, methods|
|
118
120
|
next if methods.empty?
|
119
|
-
next unless visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
|
121
|
+
next unless @options.show_all || visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
|
120
122
|
%>
|
121
123
|
<div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
|
122
124
|
<% methods.each do |method| %>
|
@@ -130,8 +132,7 @@
|
|
130
132
|
</div>
|
131
133
|
<% unless (description = method.description).empty? %>
|
132
134
|
<div class="description">
|
133
|
-
|
134
|
-
<%= description.gsub('<script>'){ |m| h(m) } %>
|
135
|
+
<%= description %>
|
135
136
|
</div>
|
136
137
|
<% end %>
|
137
138
|
<% unless method.aliases.empty? %>
|
@@ -109,7 +109,7 @@
|
|
109
109
|
next if visibilities.empty?
|
110
110
|
visibilities.each do |visibility, methods|
|
111
111
|
next if methods.empty?
|
112
|
-
next unless visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
|
112
|
+
next unless @options.show_all || visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
|
113
113
|
%>
|
114
114
|
<div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
|
115
115
|
<% methods.each do |method| %>
|
data/lib/sdoc/templatable.rb
CHANGED
@@ -32,6 +32,10 @@ module SDoc::Templatable
|
|
32
32
|
### Both +templatefile+ and +outfile+ should be Pathname-like objects.
|
33
33
|
def render_template( templatefile, context, outfile )
|
34
34
|
output = eval_template(templatefile, context)
|
35
|
+
|
36
|
+
# TODO delete this dirty hack when documentation for example for GeneratorMethods will not be cutted off by <script> tag
|
37
|
+
output = output.gsub('<script>', '<script;>')
|
38
|
+
|
35
39
|
unless $dryrun
|
36
40
|
outfile.dirname.mkpath
|
37
41
|
outfile.open( 'w', 0644 ) do |file|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voloko-sdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volodya Kolesnikov
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-17 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|