Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting from AsciiDoctor's emoji-inline-macro #12

Open
8Keep opened this issue Apr 27, 2020 · 9 comments
Open

Converting from AsciiDoctor's emoji-inline-macro #12

8Keep opened this issue Apr 27, 2020 · 9 comments

Comments

@8Keep
Copy link

8Keep commented Apr 27, 2020

Hi, I'm trying to convert docs from the Ruby Asciidoctor to Asciidoctor.js, because I'm now using Antora. I used to use emoji-inline-macro. I tried to use this module, but some emoji's aren't working. It used twemoji I'm pretty sure. Is it possible to use twemoji? Also, this project uses an old version of Asciidoctor.js. Do you have plans to update that?

@ggrossetie
Copy link
Owner

Hello @8Keep

We are already using Twemoji but maybe some emojis are missing from: https://github.com/Mogztter/asciidoctor-emoji/blob/master/src/twemoji-map.js

Unfortunately Twemoji does not provide this mapping out-of-the-box... I didn't check lately maybe there's a more up-to-date list somewhere. If that's the case, please feel free to submit a pull request 🤗

Also, this project uses an old version of Asciidoctor.js. Do you have plans to update that?

We are using an old version because Antora is still using Asciidoctor.js 1.5.9. Please note that this is a development dependency. So you can run this extension with the latest version of Asciidoctor.js. The idea behind using an old version in the tests is to make sure that this extension is compatible with Antora.

@8Keep
Copy link
Author

8Keep commented Apr 27, 2020

Hi, thanks for the quick response! And thanks for the info. I was testing an emoji test page you can find here. After some more testing, I found that a lot of the emojis could be fixed by using underscores instead of dashes, like 'left_luggage' instead of 'left-luggage'. Some like 'thumbsup', are now '+1'. Looking at your mapping file and twemoji's data files helped me a lot. I suppose it's just up to me to convert my files to use those emoji codes - good thing running Antora shows every place an emoji can't be found when it's compiling.

Edit: I think the wrong names are because we had an old version of emoji-inline-macro.

@ggrossetie
Copy link
Owner

There's currently 3245 emojis: https://twemoji.maxcdn.com/v/latest/preview.html and the map only contains 1600+ entries so a lot are missing.
I believe that "+1" is a widely used but unofficial synonym/shortcut. That would be useful to add it but I'm not sure where we can find a reference list...

@8Keep
Copy link
Author

8Keep commented Apr 27, 2020

Where did you originally get your twemoji mapping file?

@Emptyfruit
Copy link

Emptyfruit commented May 21, 2023

I'd like to add to the topic, that it is pretty hard make the plugin practically useful, since i cannot find a relevant cheat sheet.
I.e.

do not provide anything that this plugin can digest. Using https://github.com/ggrossetie/asciidoctor-emoji/blob/main/src/twemoji-map.js is not as handy, tbh.

Is there any way to translate form common emoji names to the ones that can be parsed?

@ggrossetie
Copy link
Owner

https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-annotations-full/annotations/en/annotations.json is promising we might be able to produce a reverse map.

The main issue is that Emoji shortcodes are not standardized:

Emoji shortcodes are not standardized across platforms. For example, codes from Github sometimes differ from those used on Slack.

Another good resource is: https://github.com/iamcal/emoji-data

@ggrossetie
Copy link
Owner

Even better, we could use https://github.com/iamcal/js-emoji which seems to do all the work 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants