Sha256: 830efc7e8d6ae50e6ee91c03134a805ff0007ccc6c04ecf85aa4a5d6466bd054

Contents?: true

Size: 669 Bytes

Versions: 1

Compression:

Stored size: 669 Bytes

Contents

#!/usr/bin/env ruby
# vim: ft=ruby

$: << 'lib' # debug only

require "mdoc"
require "optparse"

options = {}

optparse = OptionParser.new do |opts|
  opts.banner = "Usage: mdoc [options] filename.md"
  opts.separator "Options:"

  options[:type] = 'odt'
  opts.on('-t TYPE', '--type TYPE', 'output file type') do |type|
    options[:type] = type
  end

  opts.on_tail('-h', '--help', 'Display this screen') do
    puts opts
    exit
  end
end

optparse.parse!(ARGV)

file = ARGV[0]
raise "Only markdown file (`*.md`) can be parsed" unless file =~ /\.md$/

klass = options[:type].to_s.capitalize
eval("Mdoc::" + klass).new(file).convert

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mdoc-0.0.3 bin/mdoc