Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a1fac28ecb
Fetching contributors…

Cannot retrieve contributors at this time

executable file 13 lines (12 sloc) 0.443 kb
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/env ruby
# Usage: redcarpet [<file>...]
# 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.
if ARGV.include?('--help')
  File.read(__FILE__).split("\n").grep(/^# /).each do |line|
    puts line[2..-1]
  end
  exit 0
end

require 'redcarpet'
STDOUT.write(Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(ARGF.read))
Something went wrong with that request. Please try again.