Title / Description
Code class HTMLwithPygments < Redcarpet::Render::HTML def block_code(code, language) sha = Digest::SHA1.hexdigest(code) Rails.cache.fetch ["code", language, sha].join('-') do Pygments.highlight(code, lexer:language) end end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code