pygmalion
Syntax highlighting using the pygments.com "web service".
WHY?
I have historically used ultraviolet for any syntax highlighting. However, in order to use ultraviolet, you need to be able to use the oniguruma library. Unfortunately, some hosting services (like the Media Temple grid service) do not support this library. I needed another solution, and it seemed like something that could be outsourced.
Installation
Run the following if you haven't already:
$ gem sources -a http://gems.github.com
Install the gem(s):
$ sudo gem install -r sbfaulkner-pygmalion
Usage
In ruby...
require 'pygmalion'
...
string.highlight
string.highlight(:language => 'js')
string.highlight(:language => 'rb', :line_numbers => true)
From the command-line...
pygmalion
Example
File.read('hello.rb').highlight
Results in...
def hello
puts "hello"
end
'
Legal
Author: S. Brent Faulkner [email protected]
License: Copyright © 2008 unwwwired.net, released under the MIT license