Sha256: 0fb79a89198820f99ae56b04ab94514c1df1652a9e0fcb066872aa7b80e39dde

Contents?: true

Size: 592 Bytes

Versions: 1

Compression:

Stored size: 592 Bytes

Contents

require 'somemoji'

module Middleman
  module Somemoji
    class Converter
      def initialize(body, options)
        @body         = body
        @provider     = options[:provider]
        @format       = options[:format]
        @emoji_class  = options[:emoji_class]
        @emojis_dir   = options[:emojis_dir]
      end

      def convert
        eval("::Somemoji::#{@provider}_emoji_collection").replace_code(@body) do |emoji|
          %(<img alt="#{emoji.character}" class="#{@emoji_class}" src="#{@emojis_dir}/#{emoji.base_path}.#{@format}">)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
middleman-somemoji-0.1.0 lib/middleman-somemoji/converter.rb