2007-08-16 00:20:18 +04:00
|
|
|
|
= CodeRay
|
|
|
|
|
|
|
|
|
|
[- Tired of blue'n'gray? Try the original version of this documentation on
|
2009-11-20 18:50:06 +03:00
|
|
|
|
http://rd.cYcnus.de/coderay/doc (use Ctrl+Click to open it in its own frame.) -]
|
2007-08-16 00:20:18 +04:00
|
|
|
|
|
|
|
|
|
== About
|
|
|
|
|
CodeRay is a Ruby library for syntax highlighting.
|
|
|
|
|
|
|
|
|
|
Syntax highlighting means: 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 should have on their website
|
|
|
|
|
* solves all your problems and makes the girls run after you
|
|
|
|
|
|
2009-11-20 18:50:06 +03:00
|
|
|
|
Version: 0.7.4 (2006.october.20)
|
2007-08-16 00:20:18 +04:00
|
|
|
|
Author:: murphy (Kornelius Kalnbach)
|
|
|
|
|
Contact:: murphy rubychan de
|
|
|
|
|
Website:: coderay.rubychan.de[http://coderay.rubychan.de]
|
|
|
|
|
License:: GNU LGPL; see LICENSE file in the main directory.
|
2009-11-20 18:50:06 +03:00
|
|
|
|
Subversion:: $Id: README 219 2006-10-20 15:52:25Z murphy $
|
|
|
|
|
|
|
|
|
|
-----
|
2007-08-16 00:20:18 +04:00
|
|
|
|
|
|
|
|
|
== Installation
|
|
|
|
|
|
|
|
|
|
You need RubyGems[http://rubyforge.org/frs/?group_id=126].
|
|
|
|
|
|
|
|
|
|
% gem install coderay
|
|
|
|
|
|
2009-11-20 18:50:06 +03:00
|
|
|
|
Since CodeRay is still in beta stage, nightly buildy may be useful:
|
|
|
|
|
|
|
|
|
|
% gem install coderay -rs rd.cYcnus.de/coderay
|
|
|
|
|
|
2007-08-16 00:20:18 +04:00
|
|
|
|
|
|
|
|
|
=== Dependencies
|
|
|
|
|
|
2009-11-20 18:50:06 +03:00
|
|
|
|
CodeRay needs Ruby 1.8 and the
|
|
|
|
|
strscan[http://www.ruby-doc.org/stdlib/libdoc/strscan/rdoc/index.htm]
|
|
|
|
|
library (part of the standard library.) It should also run with Ruby 1.9 and
|
|
|
|
|
yarv.
|
2007-08-16 00:20:18 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
== Example Usage
|
|
|
|
|
(Forgive me, but this is not highlighted.)
|
|
|
|
|
|
|
|
|
|
require 'coderay'
|
|
|
|
|
|
|
|
|
|
tokens = CodeRay.scan "puts 'Hello, world!'", :ruby
|
|
|
|
|
page = tokens.html :line_numbers => :inline, :wrap => :page
|
|
|
|
|
puts page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
== Documentation
|
|
|
|
|
|
|
|
|
|
See CodeRay.
|
|
|
|
|
|
2009-11-20 18:50:06 +03:00
|
|
|
|
Please report errors in this documentation to <coderay cycnus de>.
|
2007-08-16 00:20:18 +04:00
|
|
|
|
|
|
|
|
|
|
2009-11-20 18:50:06 +03:00
|
|
|
|
-----
|
|
|
|
|
|
2007-08-16 00:20:18 +04:00
|
|
|
|
== Credits
|
|
|
|
|
|
|
|
|
|
=== Special Thanks to
|
|
|
|
|
|
|
|
|
|
* licenser (Heinz N. Gies) for ending my QBasic career, inventing the Coder
|
|
|
|
|
project and the input/output plugin system.
|
|
|
|
|
CodeRay would not exist without him.
|
|
|
|
|
|
|
|
|
|
=== Thanks to
|
|
|
|
|
|
|
|
|
|
* Caleb Clausen for writing RubyLexer (see
|
|
|
|
|
http://rubyforge.org/projects/rubylexer) and lots of very interesting mail
|
|
|
|
|
traffic
|
2009-11-20 18:50:06 +03:00
|
|
|
|
* birkenfeld (Georg Brandl) and mitsuhiku (Arnim Ronacher) for PyKleur. You
|
|
|
|
|
guys rock!
|
2007-08-16 00:20:18 +04:00
|
|
|
|
* Jamis Buck for writing Syntax (see http://rubyforge.org/projects/syntax)
|
|
|
|
|
I got some useful ideas from it.
|
|
|
|
|
* Doug Kearns and everyone else who worked on ruby.vim - it not only helped me
|
|
|
|
|
coding CodeRay, but also gave me a wonderful target to reach for the Ruby
|
|
|
|
|
scanner.
|
2009-11-20 18:50:06 +03:00
|
|
|
|
* everyone who used CodeBB on http://www.rubyforen.de and
|
|
|
|
|
http://www.infhu.de/mx
|
|
|
|
|
* iGEL, magichisoka, manveru, WoN<6F>Do and everyone I forgot from rubyforen.de
|
|
|
|
|
* Daniel and Dethix from ruby-mine.de
|
|
|
|
|
* Dookie (who is no longer with us...) and Leonidas from
|
|
|
|
|
http://www.python-forum.de
|
2007-08-16 00:20:18 +04:00
|
|
|
|
* Andreas Schwarz for finding out that CaseIgnoringWordList was not case
|
|
|
|
|
ignoring! Such things really make you write tests.
|
|
|
|
|
* matz and all Ruby gods and gurus
|
|
|
|
|
* The inventors of: the computer, the internet, the true color display, HTML &
|
2009-11-20 18:50:06 +03:00
|
|
|
|
CSS, VIM, RUBY, pizza, microwaves, guitars, scouting, programming, anime,
|
2007-08-16 00:20:18 +04:00
|
|
|
|
manga, coke and green ice tea.
|
|
|
|
|
|
|
|
|
|
Where would we be without all those people?
|
|
|
|
|
|
|
|
|
|
=== Created using
|
|
|
|
|
|
|
|
|
|
* Ruby[http://ruby-lang.org/]
|
2009-11-20 18:50:06 +03:00
|
|
|
|
* Chihiro (my Sony VAIO laptop), Henrietta (my new MacBook) and
|
|
|
|
|
Seras (my Athlon 2200+ tower)
|
|
|
|
|
* VIM[http://vim.org] and TextMate[http://macromates.com]
|
|
|
|
|
* RDE[http://homepage2.nifty.com/sakazuki/rde_e.html]
|
|
|
|
|
* Microsoft Windows (yes, I confess!) and MacOS X
|
|
|
|
|
* Firefox[http://www.mozilla.org/products/firefox/] and
|
2007-08-16 00:20:18 +04:00
|
|
|
|
Thunderbird[http://www.mozilla.org/products/thunderbird/]
|
2009-11-20 18:50:06 +03:00
|
|
|
|
* Rake[http://rake.rubyforge.org/]
|
|
|
|
|
* RubyGems[http://docs.rubygems.org/]
|
|
|
|
|
* {Subversion/TortoiseSVN}[http://tortoisesvn.tigris.org/] using Apache via
|
2007-08-16 00:20:18 +04:00
|
|
|
|
XAMPP[http://www.apachefriends.org/en/xampp.html]
|
|
|
|
|
* RDoc (though I'm quite unsatisfied with it)
|
|
|
|
|
* GNUWin32, MinGW and some other tools to make the shell under windows a bit
|
2009-11-20 18:50:06 +03:00
|
|
|
|
more useful
|
2007-08-16 00:20:18 +04:00
|
|
|
|
* Term::ANSIColor[http://term-ansicolor.rubyforge.org/]
|
|
|
|
|
|
2009-11-20 18:50:06 +03:00
|
|
|
|
---
|
2007-08-16 00:20:18 +04:00
|
|
|
|
|
|
|
|
|
* As you can see, CodeRay was created under heavy use of *free* software.
|
|
|
|
|
* So CodeRay is also *free*.
|
|
|
|
|
* If you use CodeRay to create software, think about making this software
|
|
|
|
|
*free*, too.
|
|
|
|
|
* Thanks :)
|