kyokomi / emoji Goto Github PK
View Code? Open in Web Editor NEW:sushi: emoji terminal output for golang
License: MIT License
:sushi: emoji terminal output for golang
License: MIT License
::smile:
For example, between 2.1.0 and 2.2.0,
- ":smile:": "\U0001f604",
+ ":smile:": "\u0001f604",
but \u
takes 4 digits while \U
took 8, so this string is now "\u0001" + "f604", not an emoji character.
This doesn't work:
A :smile: and another: :smile:
First of all, thanks for a nice software!
Could you add LICENSE file?
These pages might help for choosing a license.
Hello,
I'd like to use emojis in Hugo, but when I execute hello.go
test file in the terminal I get the following:
Hello World Emoji!
🍺 Beer!!!
I like a 🍕 and 🍣 !!
so I wonder if some font has to be installed in order to get proper glyphs displayed?
Hello,
Can you please update the emoji code map in this package so that it uses all the latest emojis.
I am using this package through Hugo (https://gohugo.io).
Thanks!
While it is good that Issue #20 expressed the desire to have a more up-to-date and more complete emoji list, the update to emojo_v5 in PR #27 for v2.0.0 has actually introduced errors and caused some regressions which deter users from upgrading to v2.0.0 and instead opting to stay with v1.5.1.
The emoji-v5.json from CodeFreezr/emojo_v5, as is right now, contains errors:
:+1:
👍 and :-1:
👎 are not in the list.The error CodeFreezr/emojo#3 crept into your emoji code map, e.g.:
// Mapping from character to concrete escape code.
var emojiCodeMap = map[string]string{
"::": "\U0001f590",
when v1.5.1 had
":raised_hand_with_fingers_splayed:": "\U0001f590",
With :+1:
, :-1:
, :email:
and perhaps more emoji shortcodes from v1.5.1 no longer in v2.0.0, users who have written content (e.g. blog posts) with these shortcodes in the past would see their content broken after upgrading to v2.0.0. That may be the reason why Hugo (the static website generator) is sticking with v1.5.1 and not upgrading to v2.0.0.
So, yes, it could be quite a bit of work to do so, but it would be really nice if a future updates could maintain compatibility with v1.5.1 while including new emojis from v5 or even v11 or v12.
Many thanks for your kind consideration!
And 1.1.81 is officially BugFree(tm), so if you receive any bug-reports
on it, you know they are just evil lies.
-- Linus Torvalds
How could I convert emoji string to emoji icons and vice versa?
For e.g.
msg := "😀 😃 😄 😁 😆 😅 😂 🤣 \U0001F972 😊 😇 :plus:"
I wanted to convert \U0001F972
and :plus:
to emojis
Also I could convert emojis to \U0001F972
or :plus:
format
I could convert :plus: to Emoji and Unicode strings like \U0001F972
OR
I could convert \U0001F972 to :some string: and Emoji
OR
I could convert Emoji to :plus: or \U0001F972
The Github emoji cheatsheet is quite outdated now. Is there a more-recent reference anywhere online?
While testing the new init cost debugging output in go 1.16, I found that emoji has one of the higher memory init costs in Hugo's dependencies.
An an example, these are the init costs while running hugo version
(which doesn't call into emoji):
$ GODEBUG=inittrace=1 go run . version 2>&1 | rg emoji
init github.com/kyokomi/emoji @15 ms, 3.9 ms clock, 783480 bytes, 3093 allocs
By deferring the emojiMap population until needed, emoji's init costs can be greatly reduced:
$ GODEBUG=inittrace=1 go run . version 2>&1 | rg emoji
init github.com/kyokomi/emoji @21 ms, 0.009 ms clock, 2824 bytes, 30 allocs
I have a branch with these changes. I can submit a PR if you're interested.
Hi,
Semver and vgo require 3-number tags, like v1.2.0 not v1.2. The tags in this repo like v1.5, v1.4, etc do not conform and are therefore not semver and are therefore ignored by vgo. Instead vgo will use the latest semver-conforming tag, the much older v0.0.2.
I would suggest tagging a new v1.5.1 or v1.6.0 for use with vgo and using three-number tags for future tags. Obviously the existing tags should be left alone since no doubt some other systems are using them.
See also gohugoio/hugo@1464912, which worked around the fact that v0.0.2 was the last semver-compatible tag.
Thanks.
I think that some of the emojis I try to convert using the emoji library are being converted to question marks.
Any chance it happens as a result of the emojis that comes with iOS 10 maybe?
For huge strings, it is replaced by a buffer in normal implementations due to memory considerations.
I would like it to be implemented as a Transformer.
Hi kyokomi,
It seams the emojis are mapped to unicode. Some custom emojis of GitHub are missing, like
... Is it possible to support these custom emoji, generated from image?https://github.com/github/gemoji/tree/master/images
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.