Giter VIP home page Giter VIP logo

slackmoji's Introduction

Slackmoji

This library is a shortcode-to-Unicode converter for Slack emoji. It is able to convert between (e.g.) :heart: and ❤️. Note that Slack shortcodes can be different from shortcodes used by other software such as GitHub.

Requirements

This library requires Swift Package Manager v5.3 or newer, since it uses bundled resources.

Usage

Simply include this repository in your Package.swift file and mark it as a dependency for your project. That will give you access to two functions:

import Slackmoji

let slackmoji = Slackmoji()
slackmoji.shortcodeToEmoji("heart") //-> ["❤️"]
slackmoji.emojiToShortcodes("❤️") //-> ["heart"]

Note that adding/removing the leading and trailing colons is your responsibility.

The plist data files

Slackmoji shortcodes are generated from this repository, which is included as a submodule. The Build Shortcode Plist file is an executable target that parses the emoji-data/build/data_emoji_names*.txt files and generates the property list file that is included as a bundled resource for this library.

To regenerate this plist file, simply run the Build Shortcode Plist target from the project root directory.

Documentation

Online API and tutorial documentation is available at https://riscfuture.github.io/Slackmoji/documentation/slackmoji/

DocC documentation is available, including tutorials and API documentation. For Xcode documentation, you can run

swift package generate-documentation --target Slackmoji

to generate a docarchive at .build/plugins/Swift-DocC/outputs/Slackmoji.doccarchive. You can open this docarchive file in Xcode for browseable API documentation. Or, within Xcode, open the Slackmoji package in Xcode and choose Build Documentation from the Product menu.

Tests

Unit tests can be run with swift test.

slackmoji's People

Contributors

riscfuture avatar

Stargazers

Michael Corrado avatar

Watchers

 avatar James Cloos 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.