Browse files

Support :nodoc: directives on classes.

  • Loading branch information...
1 parent 8f778ca commit a3d1078038486b93f2da076a0f8f631ce72d3227 @raggi committed Jul 27, 2010
Showing with 14 additions and 7 deletions.
  1. +14 −7 lib/hanna.rb
View
21 lib/hanna.rb
@@ -21,6 +21,11 @@ module Hanna
require 'rdoc/rdoc'
require 'rdoc/generator'
+module RDoc #:nodoc:
+ module Generator #:nodoc:
+ end
+end
+
class RDoc::Generator::Hanna
STYLE = 'styles.sass'
LAYOUT = 'layout.haml'
@@ -247,16 +252,18 @@ def render_class_tree(entries, parent=nil)
text = klass.name
end
- out << '<li>'
+ if klass.document_self
+ out << '<li>'
+ out << link_to(text, classfile(klass))
+ end
- out << link_to(text, classfile(klass))
+ subentries = @classes.select { |x| x.full_name[/^#{klass.full_name}::/] }
+ subentries.each { |x| namespaces[x.full_name] = true }
+ out << "\n<ol>" + render_class_tree(subentries, klass) + "\n</ol>"
- if subentries = @classes.select { |x| x.full_name =~ /^#{klass.full_name}::/ }
- subentries.each { |x| namespaces[x.full_name] = true }
- out << "\n<ol>" + render_class_tree(subentries, klass) + "\n</ol>"
+ if klass.document_self
+ out << '</li>'
end
-
- out << '</li>'
end
out

0 comments on commit a3d1078

Please sign in to comment.