0.0
No commit activity in last 3 years
No release in over 3 years
Albino is an interface to the Python-based Pygments library. The code was all written by Chris Wanstrath and can be found at http://github.com/github/albino David Dollar wrapped it in a gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

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