Volver al ranking

github/gemoji

Ruby

Emoji images and names.

emojirubyunicoderubygem
Crecimiento de estrellas
Estrellas
4.5k
Forks
804
Crecimiento semanal
Issues
30
2k4k
ene 2023mar 2024may 2025jul 2026
ArtefactosRubyGemsgem install gemoji
README

gemoji

This library contains character information about native emojis.

Installation

Add gemoji to your Gemfile.

gem 'gemoji'

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.

>> Emoji.find_by_alias("cat").raw
=> "🐱"  # Don't see a cat? That's U+1F431.

>> Emoji.find_by_unicode("\u{1f431}").name
=> "cat"

Adding new emoji

You can add new emoji characters to the Emoji.all list:

emoji = Emoji.create("music") do |char|
  char.add_alias "song"
  char.add_unicode_alias "\u{266b}"
  char.add_tag "notes"
end

emoji.name #=> "music"
emoji.raw  #=> "♫"
emoji.image_filename #=> "unicode/266b.png"

# Creating custom emoji (no Unicode aliases):
emoji = Emoji.create("music") do |char|
  char.add_tag "notes"
end

emoji.custom? #=> true
emoji.image_filename #=> "music.png"

As you create new emoji, you must ensure that you also create and put the images they reference by their image_filename to your assets directory.

You can customize image_filename with:

emoji = Emoji.create("music") do |char|
  char.image_filename = "subdirectory/my_emoji.gif"
end

For existing emojis, you can edit the list of aliases or add new tags in an edit block:

emoji = Emoji.find_by_alias "musical_note"

Emoji.edit_emoji(emoji) do |char|
  char.add_alias "music"
  char.add_unicode_alias "\u{266b}"
  char.add_tag "notes"
end

Emoji.find_by_alias "music"       #=> emoji
Emoji.find_by_unicode "\u{266b}"  #=> emoji
Repositorios relacionados
Textualize/rich

Rich is a Python library for rich text and beautiful formatting in the terminal.

PythonPyPIMIT Licensepythonpython3
rich.readthedocs.io/en/latest/
56.9k2.3k
twitter/twemoji

Emoji for everyone. https://twemoji.twitter.com/

HTMLMIT Licenseemojitwemoji
17.7k1.9k
tindy2013/subconverter

Utility to convert between various subscription format

C++GNU General Public License v3.0clashclashr
16.9k3.8k
carloscuesta/gitmoji

An emoji guide for your commit messages. 😜

TypeScriptnpmMIT Licenseemojigitmoji
gitmoji.dev
16.8k823
ikatyang/emoji-cheat-sheet

A markdown version emoji cheat sheet

TypeScriptnpmMIT Licenseemojicheat-sheet
13.8k4.6k
microsoft/fluentui-emoji

A collection of familiar, friendly, and modern emoji from Microsoft

PythonPyPIMIT Licenseemoji
10k557
missive/emoji-mart

🏪 One component to pick them all

TypeScriptnpmMIT Licenseemoji-pickeremoji
missiveapp.com/open/emoji-mart
9.4k904
iconify/iconify

Universal icon framework. One syntax for FontAwesome, Material Design Icons, DashIcons, Feather Icons, EmojiOne, Noto Emoji and many other open source icon sets (over 200 icon sets and ~300k icons). SVG framework, React, Vue and Svelte components!

TypeScriptnpmMIT Licenseiconsemoji
iconify.design
6.2k198
carloscuesta/gitmoji-cli

A gitmoji interactive cli tool for using emojis on commits. 💻

JavaScriptnpmMIT Licensegitmoji-cligitmoji
npmjs.com/package/gitmoji-cli
4.8k212
hfg-gmuend/openmoji

Open source emojis for designers, developers and everyone else!

HTMLCreative Commons Attribution Share Alike 4.0 Internationalopenmojiemoji
openmoji.org
4.5k264
burhanrashid52/PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.

KotlinMIT Licenseandroidimage-processing
4.5k1k
MariaLetta/free-gophers-pack

✨ This pack of 100+ gopher pictures and elements will help you to build own design of almost anything related to Go Programming Language: presentations, posts in blogs or social media, courses, videos and many, many more.

GoGo ModulesCreative Commons Zero v1.0 Universalgogolang
4k222