Created
November 7, 2008 16:31
-
-
Save petyosi/22903 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Put this in your bin directory or wherever you like; chmod +x it, and then you can use it like this: | |
# textile my-document.textile > my-document.html | |
# If you use vim, the following line gives you instant preview of your document. I know, it can be done better (.vim/ftplugin/textile.vim) | |
# nnoremap <F5> :!textile % > /tmp/textile-preview.html && gnome-open /tmp/textile-preview.html<CR><CR> | |
require 'rubygems' | |
require 'RedCloth' | |
File.open ARGV.first do |f| | |
$stdout << RedCloth.new(f.read).to_html | |
end | |
#vim set filetype=ruby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment