Sha256: 9f5401dfc6ef4b6b6b9d9e4555f2599c3bd87808b318db2f0050991f35506288

Contents?: true

Size: 364 Bytes

Versions: 14

Compression:

Stored size: 364 Bytes

Contents

# encoding: utf-8

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

    def run(content, params={})
      require 'coderay'

      # 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

14 entries across 14 versions & 1 rubygems

Version Path
nanoc3-3.1.0b1 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.0a3 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.9 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.8 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.0a2 lib/nanoc3/filters/coderay.rb
nanoc3-3.1.0a1 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.7 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.6 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.5 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.4 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.3 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.2 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.1 lib/nanoc3/filters/coderay.rb
nanoc3-3.0.0 lib/nanoc3/filters/coderay.rb