Class: HTMLwithPygments

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Defined in:
lib/tocmd/translator_local.rb,
lib/tocmd/translator_conf.rb,
lib/tocmd/markdown_render.rb,
lib/tocmd/translator.rb

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object



302
303
304
# File 'lib/tocmd/translator_local.rb', line 302

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

#doc_headerObject



298
299
300
# File 'lib/tocmd/translator_local.rb', line 298

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