Sha256: 070ac885f0c5e89065ab6458384a412794576755aaccb04850c3a763243d8dac

Contents?: true

Size: 467 Bytes

Versions: 6

Compression:

Stored size: 467 Bytes

Contents

# this file is not require'd from the root.  To use this plugin, run:
#
#    require 'rouge/plugins/redcarpet'

# this plugin depends on redcarpet
require 'redcarpet'

module Rouge
  module Plugins
    module Redcarpet
      def block_code(code, language)
        lexer = Lexer.find(language) || Lexers::Text
        formatter = Formatters::HTML.new(:css_class => "highlight #{lexer.tag}")

        Rouge.highlight(code, lexer, formatter)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rouge-0.0.9 lib/rouge/plugins/redcarpet.rb
rouge-0.0.8 lib/rouge/plugins/redcarpet.rb
rouge-0.0.7 lib/rouge/plugins/redcarpet.rb
rouge-0.0.6 lib/rouge/plugins/redcarpet.rb
rouge-0.0.5 lib/rouge/plugins/redcarpet.rb
rouge-0.0.4 lib/rouge/plugins/redcarpet.rb