class RDoc::Context::Section

def == other

def == other
  self.class === other and @title == other.title
end

def add_comment comment

def add_comment comment
  comments = Array(comment)
  comments.each do |c|
    extracted_comment = extract_comment(c)
    @comments << extracted_comment unless extracted_comment.empty?
  end
end

def aref

def aref
  title = @title || '[untitled]'
  CGI.escape(title).gsub('%', '-').sub(/^-/, '')
end

def extract_comment comment

def extract_comment comment
  case comment
  when nil
    RDoc::Comment.new ''
  when RDoc::Comment then
    if comment.text =~ /^#[ \t]*:section:.*\n/ then
      start = $`
      rest = $'
      comment.text = if start.empty? then
                       rest
                     else
                       rest.sub(/#{start.chomp}\Z/, '')
                     end
    end
    comment
  else
    raise TypeError, "unknown comment #{comment.inspect}"
  end
end

def hash # :nodoc:

:nodoc:
def hash # :nodoc:
  @title.hash
end

def in_files

def in_files
  @comments.map(&:file)
end

def initialize parent, title, comment

def initialize parent, title, comment
  @parent = parent
  @title = title ? title.strip : title
  @comments = []
  add_comment comment
end

def inspect # :nodoc:

:nodoc:
def inspect # :nodoc:
  "#<%s:0x%x %p>" % [self.class, object_id, title]
end

def marshal_dump

def marshal_dump
  [
    MARSHAL_VERSION,
    @title,
    parse,
  ]
end

def marshal_load array

def marshal_load array
  @parent  = nil
  @title    = array[1]
  @comments = array[2].parts.map { |doc| RDoc::Comment.from_document(doc) }
end

def parse

def parse
  RDoc::Markup::Document.new(*@comments.map(&:parse))
end

def plain_html

def plain_html
  @title || 'Top Section'
end

def remove_comment target_comment

def remove_comment target_comment
  @comments.delete_if do |stored_comment|
    stored_comment.file == target_comment.file
  end
end