4 # Parse a non-source file. We basically take the whole thing as one big
5 # comment. If the first character in the file is '#', we strip leading pound
8 class RDoc::Parser::Simple < RDoc::Parser
10 parse_files_matching(//)
13 # Prepare to parse a plain file
15 def initialize(top_level, file_name, content, options, stats)
18 preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
20 preprocess.handle @content do |directive, param|
21 warn "Unrecognized directive '#{directive}' in #{@file_name}"
26 # Extract the file contents and attach them to the toplevel as a comment
29 @top_level.comment = remove_private_comments(@content)
33 def remove_private_comments(comment)
34 comment.gsub(/^--[^-].*?^\+\+/m, '').sub(/^--.*/m, '')