Ruby语法高亮库:Coderay

jopen 11年前

CodeRay是一个快速和简易的语法高亮Ruby库。

特性:

输入语言

  • C, C++
  • Clojure (new)
  • CSS
  • Delphi
  • diff
  • ERB
  • Groovy
  • HAML (new)
  • HTML
  • Java
  • JavaScript
  • JSON
  • PHP
  • Python
  • Ruby
  • SQL
  • XML
  • YAML

输出格式

  • HTML snippet (inline styles)
  • HTML page (CSS classes)
  • Terminal (16 colors)
  • JSON
  • YAML
  • Ruby Array (Tokens)

tools

  • coderay executable
  • LoC counter (beta)

license

基础特性:

  • fast: 1 MB/s!
  • smart: doesn't choke on crazy code
  • safe: handles bogus input gracefully
  • pure Ruby implementation
  • no dependencies
  • plugin system
  • line numbers
  • nested languages
  • encoding-aware (Ruby 1.9+, beta)
  • extensive test suite

支持平台

  • MRI 1.8.7+
  • MRI 1.9.1+
  • JRuby 1.5.2+
  • Rubinius 1.2+

未标题-1.jpg

项目主页:http://www.open-open.com/lib/view/home/1360026089752