Class: HTMLwithPygments

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Defined in:
lib/tocmd/translator_trans.rb

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object



341
342
343
# File 'lib/tocmd/translator_trans.rb', line 341

def block_code(code, language)
  Pygments.highlight(code, :lexer => language, :options => {:encoding => 'utf-8'})
end

#doc_headerObject



337
338
339
# File 'lib/tocmd/translator_trans.rb', line 337

def doc_header()
  '<style>' + Pygments.css('.highlight',:style => 'friendly') + '</style>'
end