summaryrefslogtreecommitdiff
path: root/README.textile
blob: b44899c0cda814d557de8b96d4cc675ad9c15019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
h1. CodeRay !https://api.travis-ci.org/rubychan/coderay.png!:https://travis-ci.org/rubychan/coderay

h2. About

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.

*Syntax Highlighting*…

* makes code easier to read and maintain
* lets you detect syntax errors faster
* helps you to understand the syntax of a language
* looks nice
* is what everybody wants to have on their website
* solves all your problems and makes the girls run after you


h2. Installation

bc. gem install coderay

h3. Dependencies

CodeRay needs Ruby 1.8.7+ or 1.9.2+. It also runs on Rubinius and JRuby.

h2. Example Usage

bc.. require 'coderay'

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

p. 

h2. Documentation

See "http://coderay.rubychan.de/doc/":http://coderay.rubychan.de/doc/.