Sha256: f722a77eadad1f53618ad7f54cee6e473382cd1092d8254d17e883dc9dc4265b

Contents?: true

Size: 539 Bytes

Versions: 16

Compression:

Stored size: 539 Bytes

Contents

# encoding: utf-8

module Nanoc3::Filters
  class CodeRay < Nanoc3::Filter

    # @deprecated Use the `:colorize_syntax` filter instead.
    def run(content, params={})
      require 'coderay'

      # Warn
      warn 'The :coderay filter is deprecated; consider using the :colorize_syntax filter instead.'

      # Check params
      raise ArgumentError, "CodeRay filter requires a :language argument which is missing" if params[:language].nil?

      # Get result
      ::CodeRay.scan(content, params[:language]).html
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
nanoc3-3.1.9 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.8 lib/nanoc3/filters/coderay.rb
nanoc3-3.2.0a4 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.7 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.6 lib/nanoc3/filters/coderay.rb
nanoc3-3.2.0a3 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.5 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.4 lib/nanoc3/filters/coderay.rb
nanoc3-3.2.0a2 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.3 lib/nanoc3/filters/coderay.rb
nanoc3-3.2.0a1 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.2 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.1 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.0 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.0rc1 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.0b2 lib/nanoc3/filters/coderay.rb