Skip to content

Instantly share code, notes, and snippets.

@petyosi
Created November 7, 2008 16:31
Show Gist options
  • Save petyosi/22903 to your computer and use it in GitHub Desktop.
Save petyosi/22903 to your computer and use it in GitHub Desktop.
#!/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