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



312
313
314
# File 'lib/tocmd/translator_trans.rb', line 312

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

#doc_headerObject



308
309
310
# File 'lib/tocmd/translator_trans.rb', line 308

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