module Rouge

def self.version

def self.version
  "4.2.1"
end

def highlight(text, lexer, formatter, &b)

end
$stdout.print chunk
Rouge.highlight(large_string, 'ruby', 'html') do |chunk|
# streaming - chunks become available as they are lexed

Rouge.highlight('var foo = 1;', 'js', 'terminal256')
Rouge.highlight('@foo = 1', 'ruby', 'html')
@example

Highlight some text with a given lexer and formatter.
def highlight(text, lexer, formatter, &b)
  lexer = Lexer.find(lexer) unless lexer.respond_to? :lex
  raise "unknown lexer #{lexer}" unless lexer
  formatter = Formatter.find(formatter) unless formatter.respond_to? :format
  raise "unknown formatter #{formatter}" unless formatter
  formatter.format(lexer.lex(text), &b)
end

def load_file(path)

Other tags:
    Api: - private
def load_file(path)
  Kernel::load File.join(LIB_DIR, "rouge/#{path}.rb")
end

def load_lexers

Other tags:
    Api: - private
def load_lexers
  lexer_dir = Pathname.new(LIB_DIR) / "rouge/lexers"
  Pathname.glob(lexer_dir / '*.rb').each do |f|
    Lexers.load_lexer(f.relative_path_from(lexer_dir))
  end
end

def reload!

def reload!
  Object::send :remove_const, :Rouge
  Kernel::load __FILE__
end