Need help with coderay?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

807 Stars 114 Forks Other 1.2K Commits 126 Opened issues


Fast and easy syntax highlighting for selected languages, written in Ruby.

Services available


Need anything else?

Contributors list


Build Status Gem Version Maintainability


CodeRay is a Ruby library for syntax highlighting.

You put your code in, and you get it back colored; Keywords, strings, floats, comments - all in different colors. And with line numbers.


gem install coderay


CodeRay needs Ruby 1.8.7, 1.9.3 or 2.0+. It also runs on JRuby.

Example Usage

require 'coderay'

html = CodeRay.scan("puts 'Hello, world!'", :ruby).div(:line_numbers => :table)


See rubydoc.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.