Clean up comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
84684e00d5
commit
c3e2bdcc20
@ -9,9 +9,6 @@ class RDoc::RI::Formatter
|
|||||||
@indent = indent
|
@indent = indent
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def draw_line(label=nil)
|
def draw_line(label=nil)
|
||||||
len = @width
|
len = @width
|
||||||
len -= (label.size+1) if label
|
len -= (label.size+1) if label
|
||||||
@ -23,8 +20,6 @@ class RDoc::RI::Formatter
|
|||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def wrap(txt, prefix=@indent, linelen=@width)
|
def wrap(txt, prefix=@indent, linelen=@width)
|
||||||
return unless txt && !txt.empty?
|
return unless txt && !txt.empty?
|
||||||
work = conv_markup(txt)
|
work = conv_markup(txt)
|
||||||
@ -46,36 +41,28 @@ class RDoc::RI::Formatter
|
|||||||
puts(prefix + res.join("\n" + next_prefix))
|
puts(prefix + res.join("\n" + next_prefix))
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def blankline
|
def blankline
|
||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
##
|
||||||
|
# Called when we want to ensure a new 'wrap' starts on a newline. Only
|
||||||
# called when we want to ensure a nbew 'wrap' starts on a newline
|
# needed for HtmlFormatter, because the rest do their own line breaking.
|
||||||
# Only needed for HtmlFormatter, because the rest do their
|
|
||||||
# own line breaking
|
|
||||||
|
|
||||||
def break_to_newline
|
def break_to_newline
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def bold_print(txt)
|
def bold_print(txt)
|
||||||
print txt
|
print txt
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def raw_print_line(txt)
|
def raw_print_line(txt)
|
||||||
puts txt
|
puts txt
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
##
|
||||||
|
# Convert HTML entities back to ASCII
|
||||||
|
|
||||||
# convert HTML entities back to ASCII
|
|
||||||
def conv_html(txt)
|
def conv_html(txt)
|
||||||
txt.
|
txt.
|
||||||
gsub(/>/, '>').
|
gsub(/>/, '>').
|
||||||
@ -85,7 +72,9 @@ class RDoc::RI::Formatter
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# convert markup into display form
|
##
|
||||||
|
# Convert markup into display form
|
||||||
|
|
||||||
def conv_markup(txt)
|
def conv_markup(txt)
|
||||||
txt.
|
txt.
|
||||||
gsub(%r{<tt>(.*?)</tt>}) { "+#$1+" } .
|
gsub(%r{<tt>(.*?)</tt>}) { "+#$1+" } .
|
||||||
@ -94,8 +83,6 @@ class RDoc::RI::Formatter
|
|||||||
gsub(%r{<em>(.*?)</em>}) { "_#$1_" }
|
gsub(%r{<em>(.*?)</em>}) { "_#$1_" }
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def display_list(list)
|
def display_list(list)
|
||||||
case list.type
|
case list.type
|
||||||
|
|
||||||
@ -149,8 +136,6 @@ class RDoc::RI::Formatter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def display_flow_item(item, prefix=@indent)
|
def display_flow_item(item, prefix=@indent)
|
||||||
case item
|
case item
|
||||||
when RDoc::Markup::Flow::P, RDoc::Markup::Flow::LI
|
when RDoc::Markup::Flow::P, RDoc::Markup::Flow::LI
|
||||||
@ -174,8 +159,6 @@ class RDoc::RI::Formatter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def display_verbatim_flow_item(item, prefix=@indent)
|
def display_verbatim_flow_item(item, prefix=@indent)
|
||||||
item.body.split(/\n/).each do |line|
|
item.body.split(/\n/).each do |line|
|
||||||
print @indent, conv_html(line), "\n"
|
print @indent, conv_html(line), "\n"
|
||||||
@ -183,8 +166,6 @@ class RDoc::RI::Formatter
|
|||||||
blankline
|
blankline
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
def display_heading(text, level, indent)
|
def display_heading(text, level, indent)
|
||||||
text = strip_attributes(text)
|
text = strip_attributes(text)
|
||||||
case level
|
case level
|
||||||
@ -206,7 +187,6 @@ class RDoc::RI::Formatter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def display_flow(flow)
|
def display_flow(flow)
|
||||||
flow.each do |f|
|
flow.each do |f|
|
||||||
display_flow_item(f)
|
display_flow_item(f)
|
||||||
@ -228,7 +208,6 @@ class RDoc::RI::Formatter
|
|||||||
text.join
|
text.join
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -323,9 +302,6 @@ class RDoc::RI::AttributeFormatter < RDoc::RI::Formatter
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
##
|
|
||||||
# overridden in specific formatters
|
|
||||||
|
|
||||||
def write_attribute_text(prefix, line)
|
def write_attribute_text(prefix, line)
|
||||||
print prefix
|
print prefix
|
||||||
line.each do |achar|
|
line.each do |achar|
|
||||||
@ -334,9 +310,6 @@ class RDoc::RI::AttributeFormatter < RDoc::RI::Formatter
|
|||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# again, overridden
|
|
||||||
|
|
||||||
def bold_print(txt)
|
def bold_print(txt)
|
||||||
print txt
|
print txt
|
||||||
end
|
end
|
||||||
@ -384,7 +357,7 @@ class RDoc::RI::OverstrikeFormatter < RDoc::RI::AttributeFormatter
|
|||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# draw a string in bold
|
# Draw a string in bold
|
||||||
|
|
||||||
def bold_print(text)
|
def bold_print(text)
|
||||||
text.split(//).each do |ch|
|
text.split(//).each do |ch|
|
||||||
@ -464,10 +437,6 @@ end
|
|||||||
|
|
||||||
class RDoc::RI::HtmlFormatter < RDoc::RI::AttributeFormatter
|
class RDoc::RI::HtmlFormatter < RDoc::RI::AttributeFormatter
|
||||||
|
|
||||||
def initialize(*args)
|
|
||||||
super
|
|
||||||
end
|
|
||||||
|
|
||||||
def write_attribute_text(prefix, line)
|
def write_attribute_text(prefix, line)
|
||||||
curr_attr = 0
|
curr_attr = 0
|
||||||
line.each do |achar|
|
line.each do |achar|
|
||||||
@ -636,7 +605,6 @@ class RDoc::RI::SimpleFormatter < RDoc::RI::Formatter
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Finally, fill in the list of known formatters
|
# Finally, fill in the list of known formatters
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user