Sha256: b5bf095b4d84053b26b36696c49340f78a78a3f73808602a2e4e972bb68aa8d8

Contents?: true

Size: 669 Bytes

Versions: 2

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] = 'rtf'
  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

2 entries across 2 versions & 1 rubygems

Version Path
mdoc-0.0.2 bin/mdoc
mdoc-0.0.1 bin/mdoc