Chris@0: = CodeRay Chris@0: Chris@0: [- Tired of blue'n'gray? Try the original version of this documentation on Chris@0: coderay.rubychan.de[http://coderay.rubychan.de/doc/] (use Ctrl+Click to open it in its own frame.) -] Chris@0: Chris@0: == About Chris@0: CodeRay is a Ruby library for syntax highlighting. Chris@0: Chris@0: Syntax highlighting means: You put your code in, and you get it back colored; Chris@0: Keywords, strings, floats, comments - all in different colors. Chris@0: And with line numbers. Chris@0: Chris@0: *Syntax* *Highlighting*... Chris@0: * makes code easier to read and maintain Chris@0: * lets you detect syntax errors faster Chris@0: * helps you to understand the syntax of a language Chris@0: * looks nice Chris@0: * is what everybody should have on their website Chris@0: * solves all your problems and makes the girls run after you Chris@0: Chris@0: Version: 0.9.2 Chris@0: Author:: murphy (Kornelius Kalnbach) Chris@0: Contact:: murphy rubychan de Chris@0: Website:: coderay.rubychan.de[http://coderay.rubychan.de] Chris@0: License:: GNU LGPL; see LICENSE file in the main directory. Chris@0: Chris@0: == Installation Chris@0: Chris@0: You need RubyGems[http://rubyforge.org/frs/?group_id=126]. Chris@0: Chris@0: % gem install coderay Chris@0: Chris@0: Chris@0: === Dependencies Chris@0: Chris@0: CodeRay needs Ruby 1.8.6 or later. It also runs with Ruby 1.9.1+ and JRuby 1.1+. Chris@0: Chris@0: Chris@0: == Example Usage Chris@0: (Forgive me, but this is not highlighted.) Chris@0: Chris@0: require 'coderay' Chris@0: Chris@0: tokens = CodeRay.scan "puts 'Hello, world!'", :ruby Chris@0: page = tokens.html :line_numbers => :inline, :wrap => :page Chris@0: puts page Chris@0: Chris@0: Chris@0: == Documentation Chris@0: Chris@0: See CodeRay. Chris@0: Chris@0: Please report errors in this documentation to . Chris@0: Chris@0: Chris@0: == Credits Chris@0: Chris@0: === Special Thanks to Chris@0: Chris@0: * licenser (Heinz N. Gies) for ending my QBasic career, inventing the Coder Chris@0: project and the input/output plugin system. Chris@0: CodeRay would not exist without him. Chris@0: * bovi (Daniel Bovensiepen) for helping me out on various occasions. Chris@0: Chris@0: === Thanks to Chris@0: Chris@0: * Caleb Clausen for writing RubyLexer (see Chris@0: http://rubyforge.org/projects/rubylexer) and lots of very interesting mail Chris@0: traffic Chris@0: * birkenfeld (Georg Brandl) and mitsuhiku (Arnim Ronacher) for PyKleur, now pygments. Chris@0: You guys rock! Chris@0: * Jamis Buck for writing Syntax (see http://rubyforge.org/projects/syntax) Chris@0: I got some useful ideas from it. Chris@0: * Doug Kearns and everyone else who worked on ruby.vim - it not only helped me Chris@0: coding CodeRay, but also gave me a wonderful target to reach for the Ruby Chris@0: scanner. Chris@0: * everyone who uses CodeBB on http://www.rubyforen.de and http://www.python-forum.de Chris@0: * iGEL, magichisoka, manveru, WoNáDo and everyone I forgot from rubyforen.de Chris@0: * Dethix from ruby-mine.de Chris@0: * zickzackw Chris@0: * Dookie (who is no longer with us...) and Leonidas from http://www.python-forum.de Chris@0: * Andreas Schwarz for finding out that CaseIgnoringWordList was not case Chris@0: ignoring! Such things really make you write tests. Chris@0: * closure for the first version of the Scheme scanner. Chris@0: * Stefan Walk for the first version of the JavaScript and PHP scanners. Chris@0: * Josh Goebel for another version of the JavaScript scanner, a SQL and a Diff scanner. Chris@0: * Jonathan Younger for pointing out the licence confusion caused by wrong LICENSE file. Chris@0: * Jeremy Hinegardner for finding the shebang-on-empty-file bug in FileType. Chris@0: * Charles Oliver Nutter and Yehuda Katz for helping me benchmark CodeRay on JRuby. Chris@0: * Andreas Neuhaus for pointing out a markup bug in coderay/for_redcloth. Chris@0: * 0xf30fc7 for the FileType patch concerning Delphi file extensions. Chris@0: * The folks at redmine.org - thank you for using and fixing CodeRay! Chris@0: * Keith Pitt for his SQL scanners Chris@0: * Rob Aldred for the terminal encoder Chris@0: * Trans for pointing out $DEBUG dependencies Chris@0: * Flameeyes for finding that Term::ANSIColor was obsolete Chris@0: * matz and all Ruby gods and gurus Chris@0: * The inventors of: the computer, the internet, the true color display, HTML & Chris@0: CSS, VIM, Ruby, pizza, microwaves, guitars, scouting, programming, anime, Chris@0: manga, coke and green ice tea. Chris@0: Chris@0: Where would we be without all those people? Chris@0: Chris@0: === Created using Chris@0: Chris@0: * Ruby[http://ruby-lang.org/] Chris@0: * Chihiro (my Sony VAIO laptop); Henrietta (my old MacBook); Chris@0: Triella, born Rico (my new MacBook); as well as Chris@0: Seras and Hikari (my PCs) Chris@0: * RDE[http://homepage2.nifty.com/sakazuki/rde_e.html], Chris@0: VIM[http://vim.org] and TextMate[http://macromates.com] Chris@0: * Subversion[http://subversion.tigris.org/] Chris@0: * Redmine[http://redmine.org/] Chris@0: * Firefox[http://www.mozilla.org/products/firefox/], Chris@0: Firebug[http://getfirebug.com/], Safari[http://www.apple.com/safari/], and Chris@0: Thunderbird[http://www.mozilla.org/products/thunderbird/] Chris@0: * RubyGems[http://docs.rubygems.org/] and Rake[http://rake.rubyforge.org/] Chris@0: * TortoiseSVN[http://tortoisesvn.tigris.org/] using Apache via Chris@0: XAMPP[http://www.apachefriends.org/en/xampp.html] Chris@0: * RDoc (though I'm quite unsatisfied with it) Chris@0: * Microsoft Windows (yes, I confess!) and MacOS X Chris@0: * GNUWin32, MinGW and some other tools to make the shell under windows a bit Chris@0: less useless Chris@0: * Term::ANSIColor[http://term-ansicolor.rubyforge.org/] Chris@0: * PLEAC[http://pleac.sourceforge.net/] code examples Chris@0: Chris@0: === Free Chris@0: Chris@0: * As you can see, CodeRay was created under heavy use of *free* software. Chris@0: * So CodeRay is also *free*. Chris@0: * If you use CodeRay to create software, think about making this software Chris@0: *free*, too. Chris@0: * Thanks :)