Unicode emojis in python-markdown
Took me only four years, but I finally published the first of a bunch of tricks around staticsite I am using: Proudly presenting python-markdown-unicodeemoji ๐คฉ๐
As the mouthful of a name suggests it is a python-markdown
extension dealing with unicode and emojis. Specifically it searches in the markdown text for
occurrences of shortcodes like :heart:
and <3
and converts them to harder to type and remember
unicode โค properly wrapped and annotated so they can be styled with CSS. For the most part
this means specifying a font which can actually display them as most normal fonts aren't
particularly good at it.
The difference between this and most other implementations like mdx_unimoji is that it is not using a) a small hardcoded list of emojis and shortcodes and b) no images involved, just unicode. The shortcodes come from JoyPixels (formerly EmojiOne) and Github as well as the unicode spec. The later means that you can browse for a character with e.g. gucharmap and insert it directly in your text without needing to figure out a shortcode.
Here, have some (the total list would be 3060 emojis currently) in three
variants: no specified variant (default), text and emoji.
Press Ctrl+Shift+I
(or whatever the magic incarnation to open the HTML inspector in your browser is) and
disable the font-override for .emoji
to see how your browser would show them
without which can vary even more than withโฆ
๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐ ๏ธ ๐ ๏ธ ๐คฃ ๐คฃ๏ธ ๐คฃ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ฅฐ ๐ฅฐ๏ธ ๐ฅฐ๏ธ ๐ ๐๏ธ ๐๏ธ ๐คฉ ๐คฉ๏ธ ๐คฉ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ โบ โบ๏ธ โบ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐คช ๐คช๏ธ ๐คช๏ธ ๐ ๐๏ธ ๐๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐คญ ๐คญ๏ธ ๐คญ๏ธ ๐คซ ๐คซ๏ธ ๐คซ๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐คจ ๐คจ๏ธ ๐คจ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ถ ๐ถ๏ธ ๐ถ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ฌ ๐ฌ๏ธ ๐ฌ๏ธ ๐คฅ ๐คฅ๏ธ ๐คฅ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ช ๐ช๏ธ ๐ช๏ธ ๐คค ๐คค๏ธ ๐คค๏ธ ๐ด ๐ด๏ธ ๐ด๏ธ ๐ท ๐ท๏ธ ๐ท๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐คข ๐คข๏ธ ๐คข๏ธ ๐คฎ ๐คฎ๏ธ ๐คฎ๏ธ ๐คง ๐คง๏ธ ๐คง๏ธ ๐ฅต ๐ฅต๏ธ ๐ฅต๏ธ ๐ฅถ ๐ฅถ๏ธ ๐ฅถ๏ธ ๐ฅด ๐ฅด๏ธ ๐ฅด๏ธ ๐ต ๐ต๏ธ ๐ต๏ธ ๐คฏ ๐คฏ๏ธ ๐คฏ๏ธ ๐ค ๐ค ๏ธ ๐ค ๏ธ ๐ฅณ ๐ฅณ๏ธ ๐ฅณ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ง ๐ง๏ธ ๐ง๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ โน โน๏ธ โน๏ธ ๐ฎ ๐ฎ๏ธ ๐ฎ๏ธ ๐ฏ ๐ฏ๏ธ ๐ฏ๏ธ ๐ฒ ๐ฒ๏ธ ๐ฒ๏ธ ๐ณ ๐ณ๏ธ ๐ณ๏ธ ๐ฅบ ๐ฅบ๏ธ ๐ฅบ๏ธ ๐ฆ ๐ฆ๏ธ ๐ฆ๏ธ ๐ง ๐ง๏ธ ๐ง๏ธ ๐จ ๐จ๏ธ ๐จ๏ธ ๐ฐ ๐ฐ๏ธ ๐ฐ๏ธ ๐ฅ ๐ฅ๏ธ ๐ฅ๏ธ ๐ข ๐ข๏ธ ๐ข๏ธ ๐ญ ๐ญ๏ธ ๐ญ๏ธ ๐ฑ ๐ฑ๏ธ ๐ฑ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ฃ ๐ฃ๏ธ ๐ฃ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐ฉ ๐ฉ๏ธ ๐ฉ๏ธ ๐ซ ๐ซ๏ธ ๐ซ๏ธ ๐ฅฑ ๐ฅฑ๏ธ ๐ฅฑ๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ก ๐ก๏ธ ๐ก๏ธ ๐ ๐ ๏ธ ๐ ๏ธ ๐คฌ ๐คฌ๏ธ ๐คฌ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ฟ ๐ฟ๏ธ ๐ฟ๏ธ ๐ ๐๏ธ ๐๏ธ โ โ ๏ธ โ ๏ธ ๐ฉ ๐ฉ๏ธ ๐ฉ๏ธ ๐คก ๐คก๏ธ ๐คก๏ธ ๐น ๐น๏ธ ๐น๏ธ ๐บ ๐บ๏ธ ๐บ๏ธ ๐ป ๐ป๏ธ ๐ป๏ธ ๐ฝ ๐ฝ๏ธ ๐ฝ๏ธ ๐พ ๐พ๏ธ ๐พ๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐บ ๐บ๏ธ ๐บ๏ธ ๐ธ ๐ธ๏ธ ๐ธ๏ธ ๐น ๐น๏ธ ๐น๏ธ ๐ป ๐ป๏ธ ๐ป๏ธ ๐ผ ๐ผ๏ธ ๐ผ๏ธ ๐ฝ ๐ฝ๏ธ ๐ฝ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ฟ ๐ฟ๏ธ ๐ฟ๏ธ ๐พ ๐พ๏ธ ๐พ๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ โฃ โฃ๏ธ โฃ๏ธ ๐ ๐๏ธ ๐๏ธ โค โค๏ธ โค๏ธ ๐งก ๐งก๏ธ ๐งก๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ ๐๏ธ ๐๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ฏ ๐ฏ๏ธ ๐ฏ๏ธ ๐ข ๐ข๏ธ ๐ข๏ธ ๐ฅ ๐ฅ๏ธ ๐ฅ๏ธ ๐ซ ๐ซ๏ธ ๐ซ๏ธ ๐ฆ ๐ฆ๏ธ ๐ฆ๏ธ ๐จ ๐จ๏ธ ๐จ๏ธ ๐ณ ๐ณ๏ธ ๐ณ๏ธ ๐ฃ ๐ฃ๏ธ ๐ฃ๏ธ ๐ฌ ๐ฌ๏ธ ๐ฌ๏ธ ๐โ๐จ ๐โ๐จ๏ธ ๐โ๐จ๏ธ ๐จ ๐จ๏ธ ๐จ๏ธ ๐ฏ ๐ฏ๏ธ ๐ฏ๏ธ ๐ญ ๐ญ๏ธ ๐ญ๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐ ๐๏ธ ๐๏ธ ๐โ๐ป ๐โ๐ป๏ธ ๐โ๐ป๏ธ ๐โ๐ผ ๐โ๐ผ๏ธ ๐โ๐ผ๏ธ ๐โ๐ฝ ๐โ๐ฝ๏ธ ๐โ๐ฝ๏ธ ๐โ๐พ ๐โ๐พ๏ธ ๐โ๐พ๏ธ ๐โ๐ฟ ๐โ๐ฟ๏ธ ๐โ๐ฟ๏ธ ๐ค ๐ค๏ธ ๐ค๏ธ ๐คโ๐ป ๐คโ๐ป๏ธ ๐คโ๐ป๏ธ ๐คโ๐ผ ๐คโ๐ผ๏ธ ๐คโ๐ผ๏ธ ๐คโ๐ฝ ๐คโ๐ฝ๏ธ ๐คโ๐ฝ๏ธ ๐คโ๐พ ๐คโ๐พ๏ธ ๐คโ๐พ๏ธ ๐คโ๐ฟ ๐คโ๐ฟ๏ธ ๐คโ๐ฟ๏ธ ๐ ๐๏ธ ๐๏ธ ๐โ๐ป ๐โ๐ป๏ธ ๐โ๐ป๏ธ ๐โ๐ผ ๐โ๐ผ๏ธ ๐โ๐ผ๏ธ ๐โ๐ฝ ๐โ๐ฝ๏ธ ๐โ๐ฝ๏ธ ๐โ๐พ ๐โ๐พ๏ธ ๐โ๐พ๏ธ ๐โ๐ฟ ๐โ๐ฟ๏ธ ๐โ๐ฟ๏ธ โ โ๏ธ โ๏ธ โโ๐ป โโ๐ป๏ธ โโ๐ป๏ธ โโ๐ผ โโ๐ผ๏ธ โโ๐ผ๏ธ โโ๐ฝ โโ๐ฝ๏ธ โโ๐ฝ๏ธ โโ๐พ โโ๐พ๏ธ โโ๐พ๏ธ โโ๐ฟ โโ๐ฟ๏ธ โโ๐ฟ๏ธ ๐ ๐๏ธ ๐๏ธ ๐โ๐ป ๐โ๐ป๏ธ ๐โ๐ป๏ธ ๐โ๐ผ ๐โ๐ผ๏ธ ๐โ๐ผ๏ธ ๐โ๐ฝ ๐โ๐ฝ๏ธ ๐โ๐ฝ๏ธ ๐โ๐พ ๐โ๐พ๏ธ ๐โ๐พ๏ธ ๐โ๐ฟ ๐โ๐ฟ๏ธ ๐โ๐ฟ๏ธ ๐ ๐๏ธ ๐๏ธ ๐โ๐ป ๐โ๐ป๏ธ ๐โ๐ป๏ธ ๐โ๐ผ ๐โ๐ผ๏ธ ๐โ๐ผ๏ธ ๐โ๐ฝ ๐โ๐ฝ๏ธ ๐โ๐ฝ๏ธ ๐โ๐พ ๐โ๐พ๏ธ ๐โ๐พ๏ธ ๐โ๐ฟ ๐โ๐ฟ๏ธ ๐โ๐ฟ๏ธ ๐ ๐ ๏ธ ๐ ๏ธ ๐ โ๐ป ๐ โ๐ป๏ธ ๐ โ๐ป๏ธ ๐ โ๐ผ ๐ โ๐ผ๏ธ ๐ โ๐ผ๏ธ ๐ โ๐ฝ ๐ โ๐ฝ๏ธ ๐ โ๐ฝ๏ธ ๐ โ๐พ ๐ โ๐พ๏ธ ๐ โ๐พ๏ธ ๐ โ๐ฟ ๐ โ๐ฟ๏ธ ๐ โ๐ฟ๏ธ ๐คถ ๐คถ๏ธ ๐คถ๏ธ ๐คถโ๐ป ๐คถโ๐ป๏ธ ๐คถโ๐ป๏ธ ๐คถโ๐ผ ๐คถโ๐ผ๏ธ ๐คถโ๐ผ๏ธ ๐คถโ๐ฝ ๐คถโ๐ฝ๏ธ ๐คถโ๐ฝ๏ธ ๐คถโ๐พ ๐คถโ๐พ๏ธ ๐คถโ๐พ๏ธ ๐คถโ๐ฟ ๐คถโ๐ฟ๏ธ ๐คถโ๐ฟ๏ธ
I know what you are thinkingโฆ I have no smartphone or social media account, so that is probably the reason.