1-- Script to generate the list of emojis in T.P.Emoji.hs.
3-- curl https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json -o emoji.json
4-- stack script --resolver lts-13.17 --package aeson --package bytestring --package text --package containers tools/emojis.hs < emoji.json
6{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE OverloadedStrings #-}
9import qualified Data.ByteString.Lazy as B
10import Data.Text (Text)
13data Emoji = Emoji Text [Text]
16instance FromJSON Emoji where
17 parseJSON = withObject "Emoji" $ \v -> Emoji
24 case eitherDecode bs of
26 Right (emoji :: [Emoji]) -> do
27 let emojis = M.fromList $
28 [(alias, txt) | Emoji txt aliases <- emoji, alias <- aliases]
29 putStrLn $ prettify $ dropWhile (/='[') $ show emojis
31prettify :: String -> String
33prettify ('[':xs) = '\n':' ':' ':'[':prettify xs
34prettify (']':xs) = '\n':' ':' ':']':prettify xs
35prettify (',':'(':xs) = '\n':' ':' ':',':'(':prettify xs
36prettify (x:xs) = x:prettify xs
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list