Method: Murdoc.generate_from_file

Defined in:
lib/murdoc.rb

.generate_from_file(input, output, options = {}) ⇒ Object

Generate a single file story



34
35
36
37
38
39
40
41
42
# File 'lib/murdoc.rb', line 34

def self.generate_from_file(input, output, options = {})
  options = default_options.merge(options)
  annotator = Annotator.from_file(input, nil)
  File.open(output, "w+") do |f|
    annotated_file = annotate(input, options[:highlight], options[:do_not_count_comment_lines])
    f.puts Renderer.new(options[:template]).render(:annotated_file => annotated_file,
                                                   :stylesheet => File.read(options[:stylesheet]))
  end
end