Created
January 13, 2011 15:29
-
-
Save ahoward/778042 to your computer and use it in GitHub Desktop.
a little script to htmlize text files with github markup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# NAME | |
# markup | |
# | |
# DESCRIPTION | |
# filter files through the awesomeness of github markup | |
# see https://github.com/github/markup | |
# | |
# USAGE | |
# markup README.md README | |
# markup README.md > README | |
# cat article.txt | sed 's/python/ruby/g' | markup > out | |
# | |
input = ARGV.shift || '/dev/stdin' | |
output = ARGV.shift || '/dev/stdout' | |
markup = GitHub::Markup.render(input) | |
open(output, 'w'){|fd| fd.write(markup)} | |
BEGIN { | |
require 'rubygems' | |
require 'github/markup' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment