Sha256: d33e2a68daf489d638d07029f2b80b3872c61ee31431f61607e221a255935051

Contents?: true

Size: 852 Bytes

Versions: 81

Compression:

Stored size: 852 Bytes

Contents

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + '/../lib/')
require 'optparse'
require 'redcloth'

if %w(--version -v).include? ARGV.first
  puts "#{RedCloth::NAME} #{RedCloth::VERSION}"
  exit(0)
end

output_as = "html"
opts = OptionParser.new do |opts|
    opts.banner = "Usage: redcloth [options] [redcloth_formatted.txt]"
    opts.separator "If no file specified, STDIN will be used. If you are typing input, you can send an EOF by pressing ^D (^Z on Windows)"
    opts.separator ""
    opts.on("-o", "--output STYLE", "Output format (defaults to #{output_as})") do |o|
        output_as = o
    end
end
opts.parse! ARGV

red = RedCloth.new( ARGF.read )
out_meth = "to_#{ output_as }"
if red.respond_to? out_meth
    puts red.method( out_meth ).call
else
    abort "** No to_#{ output_as } method found for the `#{ output_as }' format"
end

Version data entries

81 entries across 81 versions & 8 rubygems

Version Path
RedCloth-4.3.4 bin/redcloth
RedCloth-4.3.3 bin/redcloth
gv-RedCloth-4.3.2 bin/redcloth
RedCloth-4.3.2 bin/redcloth
RedCloth-4.3.1 bin/redcloth
RedCloth-4.3.0 bin/redcloth
parity-RedCloth-4.2.13 bin/redcloth
parity-RedCloth-4.2.12 bin/redcloth
parity-RedCloth-4.2.11 bin/redcloth
parity-RedCloth-4.2.10 bin/redcloth
parity-RedCloth-4.2.9 bin/redcloth
jeremy-RedCloth-4.1.1 bin/redcloth
YSRedCloth-4.2.18 bin/redcloth
assplecake-RedCloth-4.2.10 bin/redcloth
YSRedCloth-4.2.17 bin/redcloth
YSRedCloth-4.2.16 bin/redcloth
gv-RedCloth-4.2.9 bin/redcloth
YSRedCloth-4.2.15 bin/redcloth
YSRedCloth-4.2.14 bin/redcloth
YSRedCloth-4.2.13 bin/redcloth