| 1 |
# CodeRay |
| 2 |
|
| 3 |
[](https://travis-ci.org/rubychan/coderay) |
| 4 |
[](https://badge.fury.io/rb/coderay) [](https://codeclimate.com/github/rubychan/coderay/maintainability) |
| 5 |
|
| 6 |
## About |
| 7 |
|
| 8 |
CodeRay is a Ruby library for syntax highlighting. |
| 9 |
|
| 10 |
You put your code in, and you get it back colored; Keywords, strings, floats, comments - all in different colors. And with line numbers. |
| 11 |
|
| 12 |
## Installation |
| 13 |
|
| 14 |
`gem install coderay` |
| 15 |
|
| 16 |
### Dependencies |
| 17 |
|
| 18 |
CodeRay needs Ruby 1.8.7, 1.9.3 or 2.0+. It also runs on JRuby. |
| 19 |
|
| 20 |
## Example Usage |
| 21 |
|
| 22 |
```ruby |
| 23 |
require 'coderay' |
| 24 |
|
| 25 |
html = CodeRay.scan("puts 'Hello, world!'", :ruby).div(:line_numbers => :table) |
| 26 |
```` |
| 27 |
|
| 28 |
## Documentation |
| 29 |
|
| 30 |
See [rubydoc](http://rubydoc.info/gems/coderay). |