Apr 19, 2010

Ruby Syntax Gem

I've been using a gem called syntax to transform Ruby code into something that looks nice in HTML. It is quite easy to install:
sudo gem install syntax
And easy to use:
require 'rubygems'
require 'syntax/convertors/html'

convertor = Syntax::Convertors::HTML.for_syntax "ruby"
html = convertor.convert(File.read(ARGV[0]))
By default it supports Ruby, XML and YAML, and there might be a bunch of other ones out there on the Internet somewhere.

Speaking of syntax, I'm wondering if anybody knows of a good colour scheme for Gvim. I've been using one called pablo that comes with it for a while since it is pretty much the only dark theme that they have that doesn't make my eyes bleed, but it still isn't amazing. Does anybody know of one that looks really good that they are willing to share?


webmat said...

Hey Rob, the vim color scheme I use is Vibrant Ink by Tim Pope. I love it, check it out:


webmat said...

Or rather, it's based on Textmate's Vibrant Ink.

Rob Britton said...

Nice, it looks good. I'll try it out for a while.

jbw said...

Here's two good vim colorschemes:


and Inkpot:

Trevoke said...

I use the railscasts colorscheme:

Rob Britton said...

Alright, I like it! I will be playing with some of these a little bit I think.

I don't know why all the ones that come with Vim make me cringe, but you'd think after it being out for so long somebody would have done something about it!