Module: Bulb::TextHelper

Defined in:
app/helpers/bulb/text_helper.rb

Instance Method Summary collapse

Instance Method Details

#highlight_blob(filename, content) ⇒ Object



3
4
5
6
7
8
# File 'app/helpers/bulb/text_helper.rb', line 3

def highlight_blob(filename, content)
  tokens, lexer = lex(content, filename: filename)

  formatter = Rouge::Formatters::HTMLLineTable.new(html_formatter)
  formatter.format(tokens)
end