ecto and Markdown
#!/usr/bin/env ruby # Markdown'ise things. # Take Markdown markup on STDIN, and output HTML to STDOUT require 'rubygems' require 'bluecloth' #print (BlueCloth.new STDIN.read).to_html file = ARGV; text = File.open(file,"r").readlines.join; html = (BlueCloth.new text).to_html File.open(file, "w").puts html;
I must first admit that since ecto supports a WYSIWYG editor therefore a script that does textile or markdown filtering does not make much sense. Also, there is the possibility of the confusion being created. Thus the textile and Markdown examples are more of examples of what can be done. A more practical example is the inter.rb given somewhere in the previous post.
Anyway, that said, the above example requires ruby, rubygems and the BlueCloth gem to be installed. If you are running Unix or Mac OS X (which you should be), you would have ruby. Install rubygems, and then install BlueCloth as:
sudo gem install BlueCloth
sudo is required for OS X.)