public
Description: A Sinatra service to colorize code
Homepage: http://febuiles.github.com/colors
Clone URL: git://github.com/febuiles/colors.git
colors /
README.markdown

Colors

Colors is:

  1. A web service for coloring the code in your HTML without having to worry about anything.
  2. The Sinatra application that powers that service. Useful in case you want to deploy it in your own environment.

The Service

By including:

<script type="text/javascript" src="http://colors.febuiles.com/colors.js">

Somewhere in your HTML file and all the <pre> tags that are accompanied by an id with a programming language will get replaced by colorful thingies. An example:

 <pre id="ruby">puts "Oh hai!"</pre>

The service will recognize the Ruby syntax and color it accordingly.

If you plan to use more than one code snippet in the same language you should give them different IDs, like this:

 <pre id="ruby_1">puts "Oh hai!"</pre>
 <pre id="ruby_2">puts "Oh noez!"</pre>

You can find more information in the project page: http://febuiles.github.com/colors.

Application

If you find that my small VPS hosting is too slow for your needs or if you don't trust me (and you probably shouldn't!) you can run the whole Sinatra application that provides the service – That's what you'll find in this repository.

I have yet to write detailed instructions on how to install it but everything minus the Thin scripts should work out of the box.

I'm always happy to give or receive support, so don't hesitate to contact me.

Supported Languages

Colors uses the awesome Pygments library on the backend, so everything supported in here should work in your Colors calls.

What's Missing

  • The Javascript is kind of dirty. This is my first approach to the language so please take a look and move things around.
  • This probably won't work in Internet Explorer. Feel free to send pull requests to fix the situation.

Contributing

If you want to give me a hand just send a pull request over Github or a patch to my email address.

Contact

Federico Builes: federico.builes@gmail.com.