- Attention folks who used this before 11:54 P.M. US Central Time on May 3rd. I fixed a typo in the instructions from gem install ruby to gem install bluecloth.
- Install the BlueCloth module by typing in
sudo gem install bluecloth. For Windows, you can simply type in
gem install bluecloth
- Here is the code I created to make it easy to convert Markdown-formatted documents to HTML:
if RUBY_PLATFORM =~ /darwin/
require_gem ‘BlueCloth‘, ‘>=0.0.4‘
s = “”
ARGF.each do |line|
s << line
doc = BlueCloth::new(s)
File.open(“markup.html“,“w“) do |file|
file << doc.to_html
To actually use the code, you can do this:
Download the plaintext script from the Blue Box widget to your left(it is called markit.rb)
*nix, OS X, go to the directory you put this script in, and type in Terminal:
ruby markit.rb <yourfile.txt>
where <yourfile.txt> is a placeholder for your actual text file containing the markdown markup (hehe, is that an oxymoron or what). Your result will be put into the file in the same directory called markup.html.
I’ll try to provide a simple GUI frontend for this script(with a file chooser or something else) on of these days, depending on my free time.