summaryrefslogtreecommitdiff
path: root/lib/rdoc/generators/html_generator.rb
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-24 04:24:29 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-24 04:24:29 +0000
commitf0346bd249ae29cdf4d9c2e88b09e63c41ff1ce8 (patch)
treec945829da8f2e7555a6b4cb7e11601dfafdc4d78 /lib/rdoc/generators/html_generator.rb
parent52975bb7a77b3a6409e50609b4baeafade035b3d (diff)
Forgot to save buffer.... sigh
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/generators/html_generator.rb')
-rw-r--r--lib/rdoc/generators/html_generator.rb57
1 files changed, 33 insertions, 24 deletions
diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb
index 89349f4b00..c5a12eee39 100644
--- a/lib/rdoc/generators/html_generator.rb
+++ b/lib/rdoc/generators/html_generator.rb
@@ -394,16 +394,21 @@ module Generators
def build_method_detail_list
outer = []
+ methods = @methods.sort
for singleton in [true, false]
for vis in [ :public, :protected, :private ]
res = []
- @methods.each do |m|
+ methods.each do |m|
if m.document_self and m.visibility == vis and m.singleton == singleton
row = {}
- row["name"] = CGI.escapeHTML(m.name)
+ if m.call_seq
+ row["callseq"] = m.call_seq
+ else
+ row["name"] = CGI.escapeHTML(m.name)
+ row["params"] = m.params
+ end
desc = m.description.strip
row["m_desc"] = desc unless desc.empty?
- row["params"] = m.params
row["aref"] = m.aref
row["visibility"] = m.visibility.to_s
@@ -878,20 +883,33 @@ module Generators
@context.singleton
end
+ def call_seq
+ cs = @context.call_seq
+ if cs
+ cs.gsub(/\n/, "<br />\n")
+ else
+ nil
+ end
+ end
+
def params
- p = @context.params.gsub(/\s*\#.*/, '')
- p = p.tr("\n", " ").squeeze(" ")
- p = "(" + p + ")" unless p[0] == ?(
-
- if (block = @context.block_params)
- block.gsub!(/\s*\#.*/, '')
- block = block.tr("\n", " ").squeeze(" ")
- if block[0] == ?(
- block.sub!(/^\(/, '').sub!(/\)/, '')
+ # params coming from a call-seq in 'C' will start with the
+ # method name
+ p = @context.params
+ if p !~ /^\w/
+ p = @context.params.gsub(/\s*\#.*/, '')
+ p = p.tr("\n", " ").squeeze(" ")
+ p = "(" + p + ")" unless p[0] == ?(
+
+ if (block = @context.block_params)
+ block.gsub!(/\s*\#.*/, '')
+ block = block.tr("\n", " ").squeeze(" ")
+ if block[0] == ?(
+ block.sub!(/^\(/, '').sub!(/\)/, '')
+ end
+ p << " {|#{block.strip}| ...}"
end
- p << " {|#{block.strip}| ...}"
end
-
CGI.escapeHTML(p)
end
@@ -948,16 +966,7 @@ module Generators
end
text = CGI.escapeHTML(t.text)
-# case t
-# when RubyToken::TkKW
-# style = "kw"
-# when RubyToken::TkCOMMENT
-# style = "cmt"
-# when RubyToken::TkSTRING
-# style = "str"
-# when RubyToken::TkREGEXP
-# style = "re"
-# end
+
if style
src << "<span class=\"#{style}\">#{text}</span>"
else