public Method

SimpleMarkup.convert(str, op)

We take a string, split it into lines, work out the type of each line, and from there deduce groups of lines (for example all lines in a paragraph). We then invoke the output formatter using a Visitor to display the result

Source Code

# File rdoc/markup/simple_markup.rb, line 249
def convert(str, op)
  @lines = Lines.new(str.split(/\r?\n/).collect { |aLine| 
                       Line.new(aLine) })
  return "" if @lines.empty?
  @lines.normalize
  assign_types_to_lines
  group = group_lines
  # call the output formatter to handle the result
  #      group.to_a.each {|i| p i}
  group.accept(@am, op)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.