diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/any_method.rb | 3 | ||||
-rw-r--r-- | lib/rdoc/markup/pre_process.rb | 2 | ||||
-rw-r--r-- | lib/rdoc/parser/c.rb | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb index 562e68461c..3d0b60790d 100644 --- a/lib/rdoc/any_method.rb +++ b/lib/rdoc/any_method.rb @@ -26,6 +26,9 @@ class RDoc::AnyMethod < RDoc::MethodAttr attr_accessor :c_function + # The section title of the method (if defined in a C file via +:category:+) + attr_accessor :section_title + # Parameters for this method attr_accessor :params diff --git a/lib/rdoc/markup/pre_process.rb b/lib/rdoc/markup/pre_process.rb index 3080ae3578..88078c9cef 100644 --- a/lib/rdoc/markup/pre_process.rb +++ b/lib/rdoc/markup/pre_process.rb @@ -163,6 +163,8 @@ class RDoc::Markup::PreProcess if RDoc::Context === code_object then section = code_object.add_section param code_object.temporary_section = section + elsif RDoc::AnyMethod === code_object then + code_object.section_title = param end blankline # ignore category if we're not on an RDoc::Context diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb index 111f6e2091..b89aaa6dcc 100644 --- a/lib/rdoc/parser/c.rb +++ b/lib/rdoc/parser/c.rb @@ -1030,7 +1030,12 @@ class RDoc::Parser::C < RDoc::Parser meth_obj.record_location @top_level + + if meth_obj.section_title + class_obj.temporary_section = class_obj.add_section(meth_obj.section_title) + end class_obj.add_method meth_obj + @stats.add_method meth_obj meth_obj.visibility = :private if 'private_method' == type end |