Class: Hylite::Rouge
Instance Attribute Summary
Attributes inherited from Hyliter
#code, #lang
Instance Method Summary
collapse
Methods inherited from Hyliter
#initialize
Instance Method Details
#call ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'lib/hylite/hyliters.rb', line 18
def call
theme = ::Rouge::Theme.find 'monokai'
formatter = ::Rouge::Formatters::Terminal256.new theme
lexer = ::Rouge::Lexer.find @lang
tokens = lexer.lex @code
formatter.format(tokens)
end
|
#type ⇒ Object
15
16
17
|
# File 'lib/hylite/hyliters.rb', line 15
def type
:rouge
end
|