gemoji

This library contains character information about native emoji, as well as image files for a few custom emoji.

Installation

Add gemoji to your Gemfile.

gem 'gemoji'

Extract images

To obtain image files as fallbacks for browsers and OS’s that don’t support emoji, run the gemoji extract command on macOS Sierra or later:

bundle exec gemoji extract public/images/emoji

This will extract images into filenames such as:

  • public/images/emoji/octocat.png
  • public/images/emoji/unicode/1f9c0.png (the :cheese: emoji)

Example Rails Helper

This would allow emojifying content such as: it's raining :cat:s and :dog:s!

See the Emoji cheat sheet for more examples.

module EmojiHelper
  def emojify(content)
    h(content).to_str.gsub(/:([\w+-]+):/) do |match|
      if emoji = Emoji.find_by_alias($1)
        %(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
      else
        match
      end
    end.html_safe if content.present?
  end
end

Unicode mapping

Translate emoji names to unicode and vice versa.

”`ruby >> Emoji.find_by_alias(“cat”).raw => “

Related Repositories

gemoji

gemoji

Emoji images and names. ...

gemoji-parser

gemoji-parser

The missing helper methods for GitHub's gemoji gem. ...

gemoji

gemoji

Emoji images and names. ...

remark-gemoji-to-emoji

remark-gemoji-to-emoji

Transform gemoji shortcodes into emoji unicodes ...

NgEmojiMap

NgEmojiMap

A simple objective-c class that encapsulates emoji-alias mapping (mapping from github/gemoji). ...


Top Contributors

josh trevorturk mislav javan juliamae asianmack danthompson aroben jeremy bkeepers jeffmcneill cobyism rick shayfrendt lautis gavingmiller elektronaut janko-m VxJasonxV wearhere marconilanna spraints skalnik phoet robrix rsenk330 tricknotes tnm TheRakken

Releases

-   v2.1.0 zip tar
-   v2.0.1 zip tar
-   v2.0.0 zip tar
-   v1.5.0 zip tar
-   v1.4.0 zip tar
-   v1.3.1 zip tar
-   v1.3.0 zip tar
-   v1.2.1 zip tar
-   v1.2.0 zip tar
-   v1.1.3 zip tar
-   v1.1.2 zip tar
-   v1.1.1 zip tar
-   v1.1.0 zip tar
-   v1.0.0 zip tar
-   v0.4.0 zip tar
-   v0.3.4 zip tar
-   v0.3.3 zip tar
-   v0.3.2 zip tar
-   v0.3.1 zip tar
-   v0.3.0 zip tar