This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
albino /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun Apr 19 16:58:48 -0700 2009 | |
| |
README.rdoc | Sun Apr 19 17:42:16 -0700 2009 | |
| |
Rakefile | Mon Apr 20 07:52:21 -0700 2009 | |
| |
albino.gemspec | Sun Apr 19 19:15:29 -0700 2009 | |
| |
config/ | Sun Apr 19 19:15:29 -0700 2009 | |
| |
lib/ | Sun Apr 19 19:15:13 -0700 2009 |
README.rdoc
Albino
Installation
$ gem sources -a http://gems.github.com
$ gem install ddollar-albino
Usage
To print out an HTMLized, Ruby-highlighted version of ’/some/file.rb’
@syntaxer = Albino.new('/some/file.rb', :ruby)
puts @syntaxer.colorize
To use another formatter, pass it as the third argument:
@syntaxer = Albino.new('/some/file.rb', :ruby, :bbcode)
puts @syntaxer.colorize
You can also use the #colorize class method:
puts Albino.colorize('/some/file.rb', :ruby)
Another also: you get a #to_s, for somewhat nicer use in Rails views.
... helper file ...
def highlight(text)
Albino.new(text, :ruby)
end
... view file ...
<%= highlight text %>
The default lexer is ‘text’. You need to specify a lexer yourself; because we are using STDIN there is no auto-detect.
To see all lexers and formatters available, run `pygmentize -L`.
Documentation
RDoc can be found at ddollar.github.com/albino
Credits
This project is an extraction from GitHub.
For this and other extractions, see github.com/github
The Albino code was all written by Chris Wanstrath chris@ozmm.org
Wrapped in a gem by David Dollar daviddollar.org







