Method: Murdoc.annotate

Defined in:
lib/murdoc.rb

.annotate(filename, highlight = true, do_not_count_comment_lines = false) ⇒ Object

‘Murdoc.annotate` arguments are gathered from CLI utility

‘highlight` regulates syntax highlighting and `do_not_count_comment_lines` flag toggles counting comment lines towards line numbering in the output.



22
23
24
25
26
27
28
29
30
31
# File 'lib/murdoc.rb', line 22

def self.annotate(filename, highlight = true, do_not_count_comment_lines = false)
  filename = File.expand_path(filename)
  annotator = Annotator.from_file(filename, nil, do_not_count_comment_lines)
  AnnotatedFile.new(filename,
      annotator.,
      annotator.source,
      annotator.source_type,
      annotator.paragraphs,
      annotator.paragraphs.map {|p| FormattedParagraph.new(p, highlight) })
end