Module: Rabbit::Parser::Ext::CodeRay

Includes:
GetText
Defined in:
lib/rabbit/parser/ext/coderay.rb

Defined Under Namespace

Classes: RabbitEncoder

Constant Summary

Constants included from GetText

GetText::DOMAIN

Class Method Summary collapse

Methods included from GetText

included

Class Method Details

.highlight(lang, text, logger) ⇒ Object


13
14
15
16
# File 'lib/rabbit/parser/ext/coderay.rb', line 13

def highlight(lang, text, logger)
  tokens = ::CodeRay.scan(text.strip, lang.to_sym)
  tokens.encode(RabbitEncoder.new)
end