File: README.markdown

package info (click to toggle)
coderay 1.1.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,356 kB
  • sloc: ruby: 9,985; makefile: 14; sh: 4; python: 1
file content (30 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (2)
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
# CodeRay

[![Build Status](https://travis-ci.org/rubychan/coderay.svg?branch=master)](https://travis-ci.org/rubychan/coderay)
[![Gem Version](https://badge.fury.io/rb/coderay.svg)](https://badge.fury.io/rb/coderay) [![Maintainability](https://api.codeclimate.com/v1/badges/e015bbd5eab45d948b6b/maintainability)](https://codeclimate.com/github/rubychan/coderay/maintainability)

## 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.

## Installation

`gem install coderay`

### Dependencies

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

## Example Usage

```ruby
require 'coderay'

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

## Documentation

See [rubydoc](http://rubydoc.info/gems/coderay).