summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 01:36:19 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 01:36:19 +0000
commitc3e2bdcc2039fdcc8bbac08016a8ac09826fdc76 (patch)
tree6833bd317f1bdc8b967a401e8f136b4eae714b62 /lib
parent84684e00d59aecc486e24c6f738ddee76cccd82e (diff)
Clean up comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/ri/formatter.rb50
1 files changed, 9 insertions, 41 deletions
diff --git a/lib/rdoc/ri/formatter.rb b/lib/rdoc/ri/formatter.rb
index 960f2e3c91..2b0db322e0 100644
--- a/lib/rdoc/ri/formatter.rb
+++ b/lib/rdoc/ri/formatter.rb
@@ -9,9 +9,6 @@ class RDoc::RI::Formatter
@indent = indent
end
-
- ######################################################################
-
def draw_line(label=nil)
len = @width
len -= (label.size+1) if label
@@ -23,8 +20,6 @@ class RDoc::RI::Formatter
puts
end
- ######################################################################
-
def wrap(txt, prefix=@indent, linelen=@width)
return unless txt && !txt.empty?
work = conv_markup(txt)
@@ -46,36 +41,28 @@ class RDoc::RI::Formatter
puts(prefix + res.join("\n" + next_prefix))
end
- ######################################################################
-
def blankline
puts
end
- ######################################################################
-
- # called when we want to ensure a nbew 'wrap' starts on a newline
- # Only needed for HtmlFormatter, because the rest do their
- # own line breaking
+ ##
+ # Called when we want to ensure a new 'wrap' starts on a newline. Only
+ # needed for HtmlFormatter, because the rest do their own line breaking.
def break_to_newline
end
- ######################################################################
-
def bold_print(txt)
print txt
end
- ######################################################################
-
def raw_print_line(txt)
puts txt
end
- ######################################################################
+ ##
+ # Convert HTML entities back to ASCII
- # convert HTML entities back to ASCII
def conv_html(txt)
txt.
gsub(/&gt;/, '>').
@@ -85,7 +72,9 @@ class RDoc::RI::Formatter
end
- # convert markup into display form
+ ##
+ # Convert markup into display form
+
def conv_markup(txt)
txt.
gsub(%r{<tt>(.*?)</tt>}) { "+#$1+" } .
@@ -94,8 +83,6 @@ class RDoc::RI::Formatter
gsub(%r{<em>(.*?)</em>}) { "_#$1_" }
end
- ######################################################################
-
def display_list(list)
case list.type
@@ -149,8 +136,6 @@ class RDoc::RI::Formatter
end
end
- ######################################################################
-
def display_flow_item(item, prefix=@indent)
case item
when RDoc::Markup::Flow::P, RDoc::Markup::Flow::LI
@@ -174,8 +159,6 @@ class RDoc::RI::Formatter
end
end
- ######################################################################
-
def display_verbatim_flow_item(item, prefix=@indent)
item.body.split(/\n/).each do |line|
print @indent, conv_html(line), "\n"
@@ -183,8 +166,6 @@ class RDoc::RI::Formatter
blankline
end
- ######################################################################
-
def display_heading(text, level, indent)
text = strip_attributes(text)
case level
@@ -206,7 +187,6 @@ class RDoc::RI::Formatter
end
end
-
def display_flow(flow)
flow.each do |f|
display_flow_item(f)
@@ -228,7 +208,6 @@ class RDoc::RI::Formatter
text.join
end
-
end
##
@@ -323,9 +302,6 @@ class RDoc::RI::AttributeFormatter < RDoc::RI::Formatter
protected
- ##
- # overridden in specific formatters
-
def write_attribute_text(prefix, line)
print prefix
line.each do |achar|
@@ -334,9 +310,6 @@ class RDoc::RI::AttributeFormatter < RDoc::RI::Formatter
puts
end
- ##
- # again, overridden
-
def bold_print(txt)
print txt
end
@@ -384,7 +357,7 @@ class RDoc::RI::OverstrikeFormatter < RDoc::RI::AttributeFormatter
end
##
- # draw a string in bold
+ # Draw a string in bold
def bold_print(text)
text.split(//).each do |ch|
@@ -464,10 +437,6 @@ end
class RDoc::RI::HtmlFormatter < RDoc::RI::AttributeFormatter
- def initialize(*args)
- super
- end
-
def write_attribute_text(prefix, line)
curr_attr = 0
line.each do |achar|
@@ -636,7 +605,6 @@ class RDoc::RI::SimpleFormatter < RDoc::RI::Formatter
end
-
##
# Finally, fill in the list of known formatters