Sha256: 90777d67f3eb727a0f5a3a3e63774d8971fa3e4ee23073169a2ffbb1ec2d1b7e

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

#!/usr/bin/env ruby

git_path = File.expand_path('../../.git', __FILE__)

if File.exist?(git_path)
  $:.unshift(File.expand_path('../../lib', __FILE__))
  $:.unshift(File.expand_path('../../vendor/qwik/lib', __FILE__))
end

require "qwik2md"
require "optparse"
require "pathname"

options = {}
OptionParser.new {|opts|
  opts.banner = "Usage: qwik2md [options] <file>"

  opts.on("-bBASE", "--base=BASE", "Base path for files (ex. `-b path/to/base` will convert `{{file(a.jpg)}}` to `path/to/base.files/a.jpg`)") do |b|
    options[:base] = b
  end
}.parse!

file = Pathname.new(ARGV[0].to_s)
base = options.fetch(:base, file.dirname.join(file.basename('.*')))
puts Qwik2md.convert(ARGF.read, base: base)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qwik2md-2.0.1 exe/qwik2md