summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/class_module.rb10
-rw-r--r--lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml8
-rw-r--r--lib/rdoc/generator/template/darkfish/table_of_contents.rhtml2
3 files changed, 17 insertions, 3 deletions
diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb
index e2bb9de68d..a520503598 100644
--- a/lib/rdoc/class_module.rb
+++ b/lib/rdoc/class_module.rb
@@ -184,7 +184,7 @@ class RDoc::ClassModule < RDoc::Context
# Appends +comment+ to the current comment, but separated by a rule. Works
# more like <tt>+=</tt>.
- def comment= comment
+ def comment= comment # :nodoc:
comment = case comment
when RDoc::Comment then
comment.normalize
@@ -217,6 +217,14 @@ class RDoc::ClassModule < RDoc::Context
end
##
+ # Does this class or module have a comment with content or is
+ # #received_nodoc true?
+
+ def documented?
+ super or !@comment_location.empty?
+ end
+
+ ##
# Iterates the ancestors of this class or module for which an
# RDoc::ClassModule exists.
diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml
index 225f811f0e..7842625840 100644
--- a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml
+++ b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml
@@ -1,4 +1,10 @@
-<% table = current.parse(current.comment).table_of_contents
+<% comment = if current.respond_to? :comment_location then
+ current.comment_location
+ else
+ current.comment
+ end
+ table = current.parse(comment).table_of_contents
+
if table.length > 1 then %>
<div id="table-of-contents">
<nav class="section">
diff --git a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
index 8f19085bb4..bebff40f6a 100644
--- a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
+++ b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
@@ -30,7 +30,7 @@
<li class="<%= klass.type %>">
<a href="<%= klass.path %>"><%= klass.full_name %></a>
<% table = []
- table.concat klass.parse(klass.comment).table_of_contents
+ table.concat klass.parse(klass.comment_location).table_of_contents
table.concat klass.section_contents
unless table.empty? then %>