Class: RailsBlogEngine::Filters::Code
- Defined in:
- lib/rails_blog_engine/filters/code.rb
Overview
Syntax highlighting for code blocks.
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#process(text, options) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rails_blog_engine/filters/code.rb', line 13 def process(text, ) if defined?(Pygments) Pygments.new(text, [:lang] || 'ruby').colorize else raise "Install pygments-gem to enable syntax highlighting" end end |