Sha256: 2885d89a994fcdf8f060903cb954a922f323ea802e4ec65568367d1d029f57e7

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

Contents

#
# Murdoc is *yet another* Doccu-like documentation generator.
# Murdoc reads ruby source files and produces annotated html documentation.
#
# See also: [Docco][do], [Rocco][ro]
#
# [do]: "http://jashkenas.github.com/docco/"
# [ro]: "http://rtomayko.github.com/rocco"
#


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

  def self.default_options
    markup_dir = File.dirname(__FILE__)+ "/../markup"
    @@options ||= {
        :template =>   "#{markup_dir}/template.haml",
        :stylesheet => "#{markup_dir}/stylesheet.css"
    }
  end
end

require "murdoc/annotator"
require "murdoc/paragraph"
require "murdoc/formatter"

Dir["#{File.dirname(File.expand_path(__FILE__))}/murdoc/languages/*.rb"].each {|lang| require lang }

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
murdoc-0.1.12 lib/murdoc.rb
murdoc-0.1.11 lib/murdoc.rb
murdoc-0.1.10 lib/murdoc.rb
murdoc-0.1.9 lib/murdoc.rb
murdoc-0.1.8 lib/murdoc.rb
murdoc-0.1.7 lib/murdoc.rb
murdoc-0.1.6 lib/murdoc.rb
murdoc-0.1.5 lib/murdoc.rb
murdoc-0.1.3 lib/murdoc.rb
murdoc-0.1.2 lib/murdoc.rb