Skip to content

Commit

Permalink
Update emoji indexes for emojione, twemoji, and gemoji (#651)
Browse files Browse the repository at this point in the history
* Update emoji indexes for emojione, twemoji, and gemoji

* Fix lint and spelling issues

* Include license in package

* Emojione 4.5 will use its own index. Also update CDN for Github's gemoji

* Fix spelling
  • Loading branch information
facelessuser authored Sep 1, 2019
1 parent 3b43470 commit f2c1cb4
Show file tree
Hide file tree
Showing 28 changed files with 9,491 additions and 7,579 deletions.
4 changes: 4 additions & 0 deletions docs/src/dictionary/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ GFM
GIF
Gemoji
Gemoji's
Gendered
GitHub
GitHub's
GitHubEmoji
Expand All @@ -46,6 +47,7 @@ JPEG
JSON
Jan
JavaScript
JoyPixels
Jun
KBD
KaTeX
Expand Down Expand Up @@ -156,6 +158,7 @@ namespace
nd
ned
nl
octocat
online
plugin
plugins
Expand All @@ -180,6 +183,7 @@ pymdownx
pypi
pytest
raphael
rebranded
regex
reindent
reinstalling
Expand Down
4 changes: 4 additions & 0 deletions docs/src/markdown/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

## 6.1.0

- **NEW**: Upgrade Twemoji to 12.1.2 using the latest JoyPixels' (formally EmojiOne) short name index in @JoyPixels/emoji-toolkit 5.0.4.
- **NEW**: Upgrade EmojiOne to 4.5.0 to the last release in the 4+ series. EmojiOne was rebranded as JoyPixels, but while the index is licensed under MIT, the image assets are no longer as permissible as they once were. The Emoji extension will only reference the last release under the older more permissible license (4.5.0). The option to use the CDN with EmojiOne 2.7 is still available as well which used an even more permissible license.
- **NEW**: Upgrade Gemoji to 3.0.1.
- **NEW**: `version` and `version_info` are now accessible via the more standard form `__version__` and `_version_info__`. The old format, while available, is now deprecated.
- **FIX**: Fix GitHub emoji CDN links to use their latest.
- **FIX**: Fix issue where entities in the form `#` would trigger MagicLink's shorthand for issues.
- **FIX**: Don't install tests when installing package.
- **FIX**: Fix for BetterEm case `**Strong*em,strong***`. Similar cases in Critic and Tilde are also adjusted.
Expand Down
49 changes: 35 additions & 14 deletions docs/src/markdown/extensions/emoji.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ The Emoji extension adds support for inserting emoji via simple short names encl

There are a number of emoji short name conventions that people may be aware of. These conventions are always tied to a specific emoji set. These conventions differ because there is no official Unicode short name convention. At the present, Emoji chooses to focus on three specific emoji sets:

- [Gemoji][gemoji] (<img align="absmiddle" alt=":smile:" class="gemoji" height="20px" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f604.png" title=":smile:" width="20px" /> <img align="absmiddle" alt=":heart:" class="gemoji" height="20px" src="https://assets-cdn.github.com/images/icons/emoji/unicode/2764.png" title=":heart:" width="20px" /> <img align="absmiddle" alt=":+1:" class="gemoji" height="20px" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png" title=":+1:" width="20px" />): Gemoji is GitHub's open source emoji solution. It contains a lot of common emoji and a couple special, non Unicode emoji (like Gemoji's `:octocat:`). If you are a GitHub user, you are probably familiar with some of the short names associated with it. Their associated CDN contains the emoji in 75x75 PNG format.
- [EmojiOne][emojione] (:smile: :heart: :thumbsup:): EmojiOne is a very complete, high quality emoji set with support for gender and skin tone modifiers. Their free emoji set includes PNGs in sizes of 32x32, 64x64, and 128x128 which are all available via a CDN. Their older (version 2.2.7) emoji set, which contains less emoji, offers SVG images as well. Emoji supports EmojiOne's newest short name mapping, but it can be used for their older set, but short names for emoji that have been added since the old set will not map to any images if this is done.
- [Twemoji][twemoji] (<img align="absmiddle" alt=":smile:" class="twemoji" height="20px" src="https://twemoji.maxcdn.com/2/72x72/1f604.png" title=":smile:" width="20px" /> <img align="absmiddle" alt=":heart:" class="twemoji" height="20px" src="https://twemoji.maxcdn.com/2/72x72/2764.png" title=":heart:" width="20px" /> <img align="absmiddle" alt=":thumbsup:" class="twemoji" height="20px" src="https://twemoji.maxcdn.com/2/72x72/1f44d.png" title=":thumbsup:" width="20px" />): Twemoji is Twitter's open source emoji set which also covers a great many emoji with skin tones and gender modifiers. The hosted CDN provides 72x72 PNG emoji or SVG emoji. While Gemoji and EmojiOne have a short name convention, Twemoji does not, and there are currently no 3rd projects that provide short names anywhere close to all the provided emoji. Since EmojiOne has the largest emoji library of the supported sets, we use EmojiOne's short name list for Twemoji. There will be a reasonable attempt to patch in emoji not found in EmojiOne's index, but if EmojiOne is ever significantly behind, we may wait for EmojiOne to catch up.
- [Gemoji][gemoji] (<img align="absmiddle" alt=":smile:" class="gemoji" height="20px" src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png" title=":smile:" width="20px" /> <img align="absmiddle" alt=":heart:" class="gemoji" height="20px" src="https://github.githubassets.com/images/icons/emoji/unicode/2764.png" title=":heart:" width="20px" /> <img align="absmiddle" alt=":+1:" class="gemoji" height="20px" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" title=":+1:" width="20px" />): Gemoji is GitHub's open source emoji solution. It contains a lot of common emoji and a couple special, non Unicode emoji (like Gemoji's `:octocat:` <img align="absmiddle" alt=":octocat:" class="gemoji" height="20px" src="https://github.githubassets.com/images/icons/emoji/octocat.png" title=":octocat:" width="20px" />). If you are a GitHub user, you are probably familiar with some of the short names associated with it. Their associated CDN contains the emoji in 75x75 PNG format.

- [EmojiOne][emojione] (:smile: :heart: :thumbsup:): EmojiOne is a high quality emoji set with support for gender and skin tone modifiers. Their free emoji set includes PNGs in sizes of 32x32, 64x64, and 128x128 which are all available via a CDN.

The older EmojiOne (version 2.2.7), can be used if desired. It contains less emoji, offers SVG images, and a less restrictive license as well. Emoji supports EmojiOne's newest short name mapping regardless of which CDN the user chooses.

4.5.0 is the last supported version of EmojiOne as they've rebranded with the name JoyPixels and now have an even more restrictive license for their graphical assets than they did under the 3+ and 4+ series. Their short name list is still used for Twemoji as that portion is available under the MIT license via their toolkit repo @JoyPixels/emoji-toolkit.

- [Twemoji][twemoji] (<img align="absmiddle" alt=":smile:" class="twemoji" height="20px" src="https://twemoji.maxcdn.com/v/latest/72x72/1f604.png" title=":smile:" width="20px" /> <img align="absmiddle" alt=":heart:" class="twemoji" height="20px" src="https://twemoji.maxcdn.com/v/latest/72x72/2764.png" title=":heart:" width="20px" /> <img align="absmiddle" alt=":thumbsup:" class="twemoji" height="20px" src="https://twemoji.maxcdn.com/v/latest/72x72/1f44d.png" title=":thumbsup:" width="20px" />): Twemoji is Twitter's open source emoji set which also covers a great many emoji with skin tones and gender modifiers. The hosted CDN provides 72x72 PNG emoji or SVG emoji.

While Gemoji and EmojiOne have a short name convention, Twemoji does not, and there are very few 3rd party projects that provide short names anywhere close to all the provided emoji that Twemoji supports. Since JoyPixels has an MIT licensed index of short names closest to what Twemoji supports, we use their short name list for Twemoji. There will be a reasonable attempt to patch in emoji not found in JoyPixels' index, but if JoyPixels is ever significantly behind, we may wait for JoyPixels to catch up.

!!! warning "Emoji Image Licensing"
PyMdown Extensions has no affiliation with EmojiOne, Gemoji, or Twemoji. The indexes generated from their sources are covered under their respective licensing. When using their images or CSS, please see their licensing terms to ensure proper usage and attributions.
Expand All @@ -27,7 +35,7 @@ There are a number of emoji short name conventions that people may be aware of.
Gemoji: https://github.com/github/gemoji/blob/master/LICENSE\
Twemoji: https://github.com/twitter/twemoji/blob/gh-pages/LICENSE-GRAPHICS

All short name indexes that Emoji uses are generated from EmojiOne's or Gemoji's latest official source tag -- Twemoji uses EmojiOne's index as the Twemoji repository does not ship with a short name index. The indexes contain the emoji names, short names, values, etc.; everything needed to insert Unicode emoji characters or specially crafted HTML elements.
All short name indexes that Emoji uses are generated from EmojiOne's or Gemoji's latest official source tag -- Twemoji uses JoyPixels' index as the Twemoji repository does not ship with a short name index. The indexes contain the emoji names, short names, values, etc.; everything needed to insert Unicode emoji characters or specially crafted HTML elements.

## Emoji Output Formats

Expand All @@ -37,21 +45,21 @@ Emoji provides various output formats that take the Unicode data associated with

## Default Emoji Indexes

By default, Emoji provides three indexes: `emojione`, `gemoji`, and `twemoji`. All indexes are generated from the most recent official release tag source (in the case of Twemoji, sort names are acquired from EmojiOne's generated index). They can be used by passing in one of the three functions below via the `emoji_index` parameter. Pass the actual function reference, not a string. If you need to create your own, just check out [Custom Emoji Indexes](#custom-emoji-generators).
By default, Emoji provides three indexes: `emojione`, `gemoji`, and `twemoji`. All indexes are generated from the most recent official release tag source (in the case of Twemoji, sort names are acquired from the generated index in @JoyPixels/emoji-toolkit). They can be used by passing in one of the three functions below via the `emoji_index` parameter. Pass the actual function reference, not a string. If you need to create your own, just check out [Custom Emoji Indexes](#custom-emoji-generators).

!!! tip
If you are attempting to configure these options in a YAML based configuration (like in [MkDocs][mkdocs]), please see the [FAQ](../faq.md#function-references-in-yaml) to see how to specify function references in YAML.

`pymdownx.emoji.emojione`
:
This is the default function that is used, and it provides an index using the latest EmojiOne supported emoji (at the time of release).
This is the default function that is used. EmojiOne was rebranded as JoyPixels and is no longer permissible enough to be used. The release used here is for 4.5.0 which is the last usable, free version of EmojiOne. Users are still required to comply with acknowledgments. JoyPixels 5.0 graphical assets will not be supported moving forward as the license is too restrictive, tough the index of their friendly names is supported under the MIT license and is used to generate friendly, short names for Twemoji.

You can always find out what tag it was built with by doing the following:

```pycon3
>>> import pymdownx.emoji1_db as e1db
>>> e1db.version
'4.0.0'
'4.5.0'
```

!!! warning "EmojiOne Update"
Expand All @@ -70,12 +78,12 @@ By default, Emoji provides three indexes: `emojione`, `gemoji`, and `twemoji`.
```pycon3
>>> import pymdownx.gemoji_db as gmdb
>>> gmdb.version
'v3.0.0'
'v3.0.1'
```

`pymdownx.emoji.twemoji`
:
This function provides an index of the latest Twemoji supported emoji (at the time of release). The associated short names are currently borrowed from EmojiOne's index.
This function provides an index of the latest Twemoji supported emoji (at the time of release). The associated short names are currently borrowed from JoyPixels' index found in their @JoyPixels/emoji-toolkit repo. JoyPixels short name index is available under the MIT license and is used as Twemoji does not provide its own list of short names.

There are a few emoji that are currently Twemoji specific, two of which are likely to always be as they are not part of the official emoji spec. The short names are listed below.

Expand Down Expand Up @@ -112,14 +120,27 @@ By default, Emoji provides three indexes: `emojione`, `gemoji`, and `twemoji`.
:woman_in_tuxedo_tone3:
:woman_in_tuxedo_tone4:
:woman_in_tuxedo_tone5:

:men_wrestling:
:women_wrestling:

:couple_with_heart_woman_man:
:couple_with_heart_woman_woman:
:couple_with_heart_man_man:

:couplekiss_woman_man:
:couplekiss_woman_woman:
:couplekiss_man_man:
```

You can always find out what tag it was built with by doing the following:

```pycon3
>>> import pymdownx.twemoji_db as twdb
>>> twdb.version
'v11.2.0'
'v12.1.2'
>>> twdb.index_version
'5.0.4'
```

## Default Emoji Generators
Expand All @@ -133,10 +154,10 @@ You can select a generator to use by passing in one of the functions below via t

`pymdownx.emoji.to_png`
:
This is a general purpose generator which provides EmojiOne, GitHub, and Twemoji CDN path(s) out of the box. Depending on the index you've chosen, you the appropriate CDN will be provided. If this ever gets out of date, a new CDN can be passed in via `image_path` and/or `non_standard_image_path`. EmojiOne actually has multiple PNGs sizes of 32, 64, and 128, but the default CDN path is the one for size 64: `https://cdn.jsdelivr.net/emojione/assets/4.0/png/64/`. You can change it for a larger or smaller PNG size by updating the size in the URL and passing the new URL in through `image_path`. The PNG output form is as follows:
This is a general purpose generator which provides EmojiOne, GitHub, and Twemoji CDN path(s) out of the box. Depending on the index you've chosen, you the appropriate CDN will be provided. If this ever gets out of date, a new CDN can be passed in via `image_path` and/or `non_standard_image_path`. EmojiOne actually has multiple PNGs sizes of 32, 64, and 128, but the default CDN path is the one for size 64: `https://cdn.jsdelivr.net/emojione/assets/4.5/png/64/`. You can change it for a larger or smaller PNG size by updating the size in the URL and passing the new URL in through `image_path`. The PNG output form is as follows:

```html
<img alt="😄" class="emojione" src="https://cdn.jsdelivr.net/emojione/assets/4.0/png/64/1f604.png" title=":smile:" />
<img alt="😄" class="emojione" src="https://cdn.jsdelivr.net/emojione/assets/4.5/png/64/1f604.png" title=":smile:" />
```

**Generator Specific Options**
Expand Down Expand Up @@ -168,7 +189,7 @@ You can select a generator to use by passing in one of the functions below via t
:
This generator was written to support PNG sprite output for EmojiOne. It is expected that this will be used in conjunction with the the official EmojiOne CSS. You can include the CSS from the CDN in your document. The CSS comes in three sizes: 32, 64, 128. Make sure to set the correct size in the options to generate the appropriate classes.

Example CDN for the 4.0 version with 64px PNGs: `https://cdn.jsdelivr.net/emojione/assets/4.0/sprites/emojione-sprite-64.min.css`.
Example CDN for the 4.5 version with 64px PNGs: `https://cdn.jsdelivr.net/emojione/assets/4.5/sprites/emojione-sprite-64.min.css`.

`to_png_sprite` outputs the emoji as a span in the form below. The CSS will apply the appropriate mapping in the sprite PNG to the background image of the span.

Expand Down Expand Up @@ -201,7 +222,7 @@ You can select a generator to use by passing in one of the functions below via t

`pymdownx.emoji.to_awesome`
:
This generator is another EmojiOne specific output called EmojiOne Awesome. It aims to give a font-awesome like interface for EmojiOne. The `emojione-awesome` CDN currently follows this format: https://cdn.jsdelivr.net/npm/emojione@4.0.0/extras/css/emojione-awesome.css, so update accordingly. The output format is:
This generator is another EmojiOne specific output called EmojiOne Awesome. It aims to give a font-awesome like interface for EmojiOne. The `emojione-awesome` CDN currently follows this format: https://cdn.jsdelivr.net/npm/emojione@4.5.0/extras/css/emojione-awesome.css, so update accordingly. The output format is:

```html
<i class="e1a-smile"></i>
Expand Down
10 changes: 5 additions & 5 deletions pymdownx/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
SUPPORTED_INDEXES = ('emojione', 'gemoji', 'twemoji')
UNICODE_VARIATION_SELECTOR_16 = 'fe0f'
EMOJIONE_SVG_CDN = 'https://cdn.jsdelivr.net/emojione/assets/svg/'
EMOJIONE_PNG_CDN = 'https://cdn.jsdelivr.net/emojione/assets/4.0/png/64/'
TWEMOJI_SVG_CDN = 'https://twemoji.maxcdn.com/2/svg/'
TWEMOJI_PNG_CDN = 'https://twemoji.maxcdn.com/2/72x72/'
GITHUB_UNICODE_CDN = 'https://assets-cdn.github.com/images/icons/emoji/unicode/'
GITHUB_CDN = 'https://assets-cdn.github.com/images/icons/emoji/'
EMOJIONE_PNG_CDN = 'https://cdn.jsdelivr.net/emojione/assets/4.5/png/64/'
TWEMOJI_SVG_CDN = 'https://twemoji.maxcdn.com/v/latest/svg/'
TWEMOJI_PNG_CDN = 'https://twemoji.maxcdn.com/v/latest/72x72/'
GITHUB_UNICODE_CDN = 'https://github.githubassets.com/images/icons/emoji/unicode/'
GITHUB_CDN = 'https://github.githubassets.com/images/icons/emoji/'
NO_TITLE = 'none'
LONG_TITLE = 'long'
SHORT_TITLE = 'short'
Expand Down
2 changes: 1 addition & 1 deletion pymdownx/emoji1_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Copyright (c) http://www.emojione.com
"""
from __future__ import unicode_literals
version = "4.0.0"
version = "4.5.0"
name = "emojione"
emoji = {
":100:": {
Expand Down
Loading

0 comments on commit f2c1cb4

Please sign in to comment.