Git Product home page Git Product logo

meteor-twemoji's Introduction

meteor-twemoji

A Meteor package to convert emoji codes (like the ones used by GitHub and Slack) into twitter-style emoji images. This is a fork of meteor-emoji that keeps the same API but has graphics from Twitter.

Installation

Using the Meteor Package System, add the emoji package from Atmosphere:

npm install git+ssh://[email protected]:mastastealth/meteor-twemoji.git --save

Usage

Javascript

In your app, use Emoji.convert(text) to emojify strings. All substrings of the general form :emoji_name: will be replaced with <img> tags that should just work. The converter isn't smart about emoji that don't actually exist.

HTML

If you wish to insert an emoji inside your HTML you can use the emoji helper followed by the name of the emoji you wish to display:

{{> emoji ":alien:"}}

Alternatively, you can emojify a whole block:

{{#emoji}}:smile:, not :cry:{{/emoji}}

You can also use this in combination with the showdown Meteor package:

{{#markdown}}{{#emoji}}your_raw_markdown_text{{/emoji}}{{/markdown}}

Styling

The generated <img> tags are conveniently adorned with the emoji class, so you can set emoji-specific styling through that. Juts as instructed in Twemoji, if you'd like to size the emoji according to the surrounding text, you can use the following CSS:

img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.1em;
}

Authors

This code comes from a Meteor package created by @AlarmingCow, now maintained by @SeriousM. All graphics were created by Twitter and are licensed under CC-BY 4.0.

meteor-twemoji's People

Contributors

alarmingcow avatar devonbarrett avatar dmfrancisco avatar mastastealth avatar seriousm avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.