Sha256: 572fa63fbb7adf5cda61026f30decaa8a7c840289a4c635f9c94eab6c6236404

Contents?: true

Size: 772 Bytes

Versions: 4

Compression:

Stored size: 772 Bytes

Contents

#!/usr/bin/env ruby
#
# Usage: [env RDISCOUNT_EXTENSIONS='<extension>,...'] rdiscount [<file>...]
# no <file> or when <file> is '-', read Markdown source text from standard input.
#
# Convert one or more Markdown files to HTML and write to standard output.
# With no <file> or when <file> is '-', read Markdown source text from
# standard input.  Optionally, the RDISCOUNT_EXTENSIONS environment variable
# can specify a comma-separated list of extensions to enable in RDiscount.
#
if ARGV.include?('--help')
  File.read(__FILE__).split("\n").grep(/^# /).each do |line|
    puts line[2..-1]
  end
  exit 0
end

require 'rdiscount'
extensions = ENV['RDISCOUNT_EXTENSIONS'].to_s.split(',').map{ |key| key.to_sym }
STDOUT.write(RDiscount.new(ARGF.read, *extensions).to_html)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rdiscount-2.2.7.3 bin/rdiscount
rdiscount-2.2.7.2 bin/rdiscount
rdiscount-2.2.7.1 bin/rdiscount
rdiscount-2.2.7 bin/rdiscount