From a9e159d83089cd8a0ce95e78181d74795f4de219 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 7 Feb 2017 14:09:07 -0500 Subject: [PATCH] emoji: fix the template output for markdown Signed-off-by: Vincent Batts --- emoji/Makefile | 14 +- emoji/emojimap.json | 2 +- emoji/list.md | 513 +++++++++++++++++++-------------------- emoji/map.go | 12 + emoji/map_gen.go | 525 ++++++++++++++++++++++++++++++++++++++++ emoji/map_gen.tmpl | 15 -- emoji/map_json.go | 55 ++++- emoji/markdown_gen.tmpl | 20 -- 8 files changed, 855 insertions(+), 301 deletions(-) create mode 100644 emoji/map_gen.go delete mode 100644 emoji/map_gen.tmpl delete mode 100644 emoji/markdown_gen.tmpl diff --git a/emoji/Makefile b/emoji/Makefile index b1236b2..9e2fa72 100644 --- a/emoji/Makefile +++ b/emoji/Makefile @@ -2,12 +2,12 @@ default: map_gen.go list.md .PHONY: map_gen.go -map_gen.go: map_json.go map.go emojimap.json map_gen.tmpl - rm -f map_gen.go - go run map_json.go -template map_gen.tmpl -in ./emojimap.json -out ./$@ +map_gen.go: map_json.go map.go emojimap.json + rm -f $@ + go run map_json.go -template map_gen -in ./emojimap.json -out ./$@ -.PHONY: map_gen.go -list.md: map_json.go map.go emojimap.json markdown_gen.tmpl - rm -f map_gen.go - go run map_json.go -template markdown_gen.tmpl -in ./emojimap.json -out ./$@ +.PHONY: list.md +list.md: map_json.go map.go emojimap.json + rm -f $@ + go run map_json.go -template markdown_gen -in ./emojimap.json -out ./$@ diff --git a/emoji/emojimap.json b/emoji/emojimap.json index 9a32627..b02806c 100644 --- a/emoji/emojimap.json +++ b/emoji/emojimap.json @@ -133,7 +133,7 @@ [":man:"], [":maple_leaf:"], [":mask:"], - [":metal:"], + [":metal:", "U+1F918"], [":microscope:"], [":moneybag:"], [":monkey:"], diff --git a/emoji/list.md b/emoji/list.md index f78613a..3426c24 100644 --- a/emoji/list.md +++ b/emoji/list.md @@ -1,3 +1,4 @@ + ## Emoji Map list _THIS FILE IS GENERATED. DO NOT EDIT._ @@ -14,259 +15,259 @@ This ordered list of emojiwords is the conventional order for the practice of co draft+1 ### List - * `0` -- :+1: `:+1:` - * `1` -- :8ball: `:8ball:` - * `2` -- :airplane: `:airplane:` - * `3` -- :alien: `:alien:` - * `4` -- :anchor: `:anchor:` - * `5` -- :angel: `:angel:` - * `6` -- :angry: `:angry:` - * `7` -- :ant: `:ant:` - * `8` -- :apple: `:apple:` - * `9` -- :art: `:art:` - * `10` -- :baby: `:baby:` - * `11` -- :baby_bottle: `:baby_bottle:` - * `12` -- :back: `:back:` - * `13` -- :bamboo: `:bamboo:` - * `14` -- :banana: `:banana:` - * `15` -- :barber: `:barber:` - * `16` -- :bathtub: `:bathtub:` - * `17` -- :beer: `:beer:` - * `18` -- :bell: `:bell:` - * `19` -- :bicyclist: `:bicyclist:` - * `20` -- :bird: `:bird:` - * `21` -- :birthday: `:birthday:` - * `22` -- :blossom: `:blossom:` - * `23` -- :blue_car: `:blue_car:` - * `24` -- :boar: `:boar:` - * `25` -- :bomb: `:bomb:` - * `26` -- :boom: `:boom:` - * `27` -- :bow: `:bow:` - * `28` -- :boy: `:boy:` - * `29` -- :broken_heart: `:broken_heart:` - * `30` -- :bulb: `:bulb:` - * `31` -- :bus: `:bus:` - * `32` -- :cactus: `:cactus:` - * `33` -- :calendar: `:calendar:` - * `34` -- :camera: `:camera:` - * `35` -- :candy: `:candy:` - * `36` -- :cat: `:cat:` - * `37` -- :cherries: `:cherries:` - * `38` -- :children_crossing: `:children_crossing:` - * `39` -- :chocolate_bar: `:chocolate_bar:` - * `40` -- :clap: `:clap:` - * `41` -- :cloud: `:cloud:` - * `42` -- :clubs: `:clubs:` - * `43` -- :cn: `:cn:` - * `44` -- :coffee: `:coffee:` - * `45` -- :construction: `:construction:` - * `46` -- :cookie: `:cookie:` - * `47` -- :copyright: `:copyright:` - * `48` -- :corn: `:corn:` - * `49` -- :cow: `:cow:` - * `50` -- :crescent_moon: `:crescent_moon:` - * `51` -- :crown: `:crown:` - * `52` -- :cry: `:cry:` - * `53` -- :crystal_ball: `:crystal_ball:` - * `54` -- :curly_loop: `:curly_loop:` - * `55` -- :dancers: `:dancers:` - * `56` -- :dash: `:dash:` - * `57` -- :de: `:de:` - * `58` -- :diamonds: `:diamonds:` - * `59` -- :dog: `:dog:` - * `60` -- :doughnut: `:doughnut:` - * `61` -- :dragon: `:dragon:` - * `62` -- :dvd: `:dvd:` - * `63` -- :ear: `:ear:` - * `64` -- :eggplant: `:eggplant:` - * `65` -- :elephant: `:elephant:` - * `66` -- :end: `:end:` - * `67` -- :envelope: `:envelope:` - * `68` -- :es: `:es:` - * `69` -- :eyes: `:eyes:` - * `70` -- :facepunch: `:facepunch:` - * `71` -- :family: `:family:` - * `72` -- :ferris_wheel: `:ferris_wheel:` - * `73` -- :finnadie: `:finnadie:` - * `74` -- :fire: `:fire:` - * `75` -- :fireworks: `:fireworks:` - * `76` -- :floppy_disk: `:floppy_disk:` - * `77` -- :football: `:football:` - * `78` -- :fork_and_knife: `:fork_and_knife:` - * `79` -- :four_leaf_clover: `:four_leaf_clover:` - * `80` -- :fr: `:fr:` - * `81` -- :fries: `:fries:` - * `82` -- :frog: `:frog:` - * `83` -- :fu: `:fu:` - * `84` -- :full_moon: `:full_moon:` - * `85` -- :game_die: `:game_die:` - * `86` -- :eu: `:eu:` - * `87` -- :gem: `:gem:` - * `88` -- :girl: `:girl:` - * `89` -- :goat: `:goat:` - * `90` -- :grimacing: `:grimacing:` - * `91` -- :grin: `:grin:` - * `92` -- :guardsman: `:guardsman:` - * `93` -- :guitar: `:guitar:` - * `94` -- :gun: `:gun:` - * `95` -- :hamburger: `:hamburger:` - * `96` -- :hammer: `:hammer:` - * `97` -- :hamster: `:hamster:` - * `98` -- :hear_no_evil: `:hear_no_evil:` - * `99` -- :heart: `:heart:` - * `100` -- :heart_eyes_cat: `:heart_eyes_cat:` - * `101` -- :hearts: `:hearts:` - * `102` -- :heavy_check_mark: `:heavy_check_mark:` - * `103` -- :moyai: `:moyai:` - * `104` -- :izakaya_lantern: `:izakaya_lantern:` - * `105` -- :helicopter: `:helicopter:` - * `106` -- :hocho: `:hocho:` - * `107` -- :honeybee: `:honeybee:` - * `108` -- :horse: `:horse:` - * `109` -- :horse_racing: `:horse_racing:` - * `110` -- :hourglass: `:hourglass:` - * `111` -- :house: `:house:` - * `112` -- :hurtrealbad: `:hurtrealbad:` - * `113` -- :icecream: `:icecream:` - * `114` -- :imp: `:imp:` - * `115` -- :it: `:it:` - * `116` -- :jack_o_lantern: `:jack_o_lantern:` - * `117` -- :japanese_goblin: `:japanese_goblin:` - * `118` -- :jp: `:jp:` - * `119` -- :key: `:key:` - * `120` -- :kiss: `:kiss:` - * `121` -- :kissing_cat: `:kissing_cat:` - * `122` -- :koala: `:koala:` - * `123` -- :kr: `:kr:` - * `124` -- :lemon: `:lemon:` - * `125` -- :lipstick: `:lipstick:` - * `126` -- :lock: `:lock:` - * `127` -- :lollipop: `:lollipop:` - * `128` -- :man: `:man:` - * `129` -- :maple_leaf: `:maple_leaf:` - * `130` -- :mask: `:mask:` - * `131` -- :metal: `:metal:` - * `132` -- :microscope: `:microscope:` - * `133` -- :moneybag: `:moneybag:` - * `134` -- :monkey: `:monkey:` - * `135` -- :mount_fuji: `:mount_fuji:` - * `136` -- :muscle: `:muscle:` - * `137` -- :mushroom: `:mushroom:` - * `138` -- :musical_keyboard: `:musical_keyboard:` - * `139` -- :musical_score: `:musical_score:` - * `140` -- :nail_care: `:nail_care:` - * `141` -- :new_moon: `:new_moon:` - * `142` -- :no_entry: `:no_entry:` - * `143` -- :nose: `:nose:` - * `144` -- :notes: `:notes:` - * `145` -- :nut_and_bolt: `:nut_and_bolt:` - * `146` -- :o: `:o:` - * `147` -- :ocean: `:ocean:` - * `148` -- :ok_hand: `:ok_hand:` - * `149` -- :on: `:on:` - * `150` -- :package: `:package:` - * `151` -- :palm_tree: `:palm_tree:` - * `152` -- :panda_face: `:panda_face:` - * `153` -- :paperclip: `:paperclip:` - * `154` -- :partly_sunny: `:partly_sunny:` - * `155` -- :passport_control: `:passport_control:` - * `156` -- :paw_prints: `:paw_prints:` - * `157` -- :peach: `:peach:` - * `158` -- :penguin: `:penguin:` - * `159` -- :phone: `:phone:` - * `160` -- :pig: `:pig:` - * `161` -- :pill: `:pill:` - * `162` -- :pineapple: `:pineapple:` - * `163` -- :pizza: `:pizza:` - * `164` -- :point_left: `:point_left:` - * `165` -- :point_right: `:point_right:` - * `166` -- :poop: `:poop:` - * `167` -- :poultry_leg: `:poultry_leg:` - * `168` -- :pray: `:pray:` - * `169` -- :princess: `:princess:` - * `170` -- :purse: `:purse:` - * `171` -- :pushpin: `:pushpin:` - * `172` -- :rabbit: `:rabbit:` - * `173` -- :rainbow: `:rainbow:` - * `174` -- :raised_hand: `:raised_hand:` - * `175` -- :recycle: `:recycle:` - * `176` -- :red_car: `:red_car:` - * `177` -- :registered: `:registered:` - * `178` -- :ribbon: `:ribbon:` - * `179` -- :rice: `:rice:` - * `180` -- :rocket: `:rocket:` - * `181` -- :roller_coaster: `:roller_coaster:` - * `182` -- :rooster: `:rooster:` - * `183` -- :ru: `:ru:` - * `184` -- :sailboat: `:sailboat:` - * `185` -- :santa: `:santa:` - * `186` -- :satellite: `:satellite:` - * `187` -- :satisfied: `:satisfied:` - * `188` -- :saxophone: `:saxophone:` - * `189` -- :scissors: `:scissors:` - * `190` -- :see_no_evil: `:see_no_evil:` - * `191` -- :sheep: `:sheep:` - * `192` -- :shell: `:shell:` - * `193` -- :shoe: `:shoe:` - * `194` -- :ski: `:ski:` - * `195` -- :skull: `:skull:` - * `196` -- :sleepy: `:sleepy:` - * `197` -- :smile: `:smile:` - * `198` -- :smiley_cat: `:smiley_cat:` - * `199` -- :smirk: `:smirk:` - * `200` -- :smoking: `:smoking:` - * `201` -- :snail: `:snail:` - * `202` -- :snake: `:snake:` - * `203` -- :snowflake: `:snowflake:` - * `204` -- :soccer: `:soccer:` - * `205` -- :soon: `:soon:` - * `206` -- :space_invader: `:space_invader:` - * `207` -- :spades: `:spades:` - * `208` -- :speak_no_evil: `:speak_no_evil:` - * `209` -- :star: `:star:` - * `210` -- :stars: `:stars:` - * `211` -- :statue_of_liberty: `:statue_of_liberty:` - * `212` -- :steam_locomotive: `:steam_locomotive:` - * `213` -- :sunflower: `:sunflower:` - * `214` -- :sunglasses: `:sunglasses:` - * `215` -- :sunny: `:sunny:` - * `216` -- :sunrise: `:sunrise:` - * `217` -- :surfer: `:surfer:` - * `218` -- :swimmer: `:swimmer:` - * `219` -- :syringe: `:syringe:` - * `220` -- :tada: `:tada:` - * `221` -- :tangerine: `:tangerine:` - * `222` -- :taxi: `:taxi:` - * `223` -- :tennis: `:tennis:` - * `224` -- :tent: `:tent:` - * `225` -- :thought_balloon: `:thought_balloon:` - * `226` -- :tm: `:tm:` - * `227` -- :toilet: `:toilet:` - * `228` -- :tongue: `:tongue:` - * `229` -- :tophat: `:tophat:` - * `230` -- :tractor: `:tractor:` - * `231` -- :trolleybus: `:trolleybus:` - * `232` -- :trollface: `:trollface:` - * `233` -- :trophy: `:trophy:` - * `234` -- :trumpet: `:trumpet:` - * `235` -- :turtle: `:turtle:` - * `236` -- :two_men_holding_hands: `:two_men_holding_hands:` - * `237` -- :two_women_holding_hands: `:two_women_holding_hands:` - * `238` -- :uk: `:uk:` - * `239` -- :umbrella: `:umbrella:` - * `240` -- :unlock: `:unlock:` - * `241` -- :us: `:us:` - * `242` -- :v: `:v:` - * `243` -- :vhs: `:vhs:` - * `244` -- :violin: `:violin:` - * `245` -- :warning: `:warning:` - * `246` -- :watermelon: `:watermelon:` - * `247` -- :wave: `:wave:` - * `248` -- :wavy_dash: `:wavy_dash:` - * `249` -- :wc: `:wc:` - * `250` -- :wheelchair: `:wheelchair:` - * `251` -- :woman: `:woman:` - * `252` -- :x: `:x:` - * `253` -- :yum: `:yum:` - * `254` -- :zap: `:zap:` - * `255` -- :zzz: `:zzz:` + * `0` -- :+1: `:+1:` + * `1` -- :8ball: `:8ball:` + * `2` -- :airplane: `:airplane:` + * `3` -- :alien: `:alien:` + * `4` -- :anchor: `:anchor:` + * `5` -- :angel: `:angel:` + * `6` -- :angry: `:angry:` + * `7` -- :ant: `:ant:` + * `8` -- :apple: `:apple:` + * `9` -- :art: `:art:` + * `10` -- :baby: `:baby:` + * `11` -- :baby_bottle: `:baby_bottle:` + * `12` -- :back: `:back:` + * `13` -- :bamboo: `:bamboo:` + * `14` -- :banana: `:banana:` + * `15` -- :barber: `:barber:` + * `16` -- :bathtub: `:bathtub:` + * `17` -- :beer: `:beer:` + * `18` -- :bell: `:bell:` + * `19` -- :bicyclist: `:bicyclist:` + * `20` -- :bird: `:bird:` + * `21` -- :birthday: `:birthday:` + * `22` -- :blossom: `:blossom:` + * `23` -- :blue_car: `:blue_car:` + * `24` -- :boar: `:boar:` + * `25` -- :bomb: `:bomb:` + * `26` -- :boom: `:boom:` + * `27` -- :bow: `:bow:` + * `28` -- :boy: `:boy:` + * `29` -- :broken_heart: `:broken_heart:` + * `30` -- :bulb: `:bulb:` + * `31` -- :bus: `:bus:` + * `32` -- :cactus: `:cactus:` + * `33` -- :calendar: `:calendar:` + * `34` -- :camera: `:camera:` + * `35` -- :candy: `:candy:` + * `36` -- :cat: `:cat:` + * `37` -- :cherries: `:cherries:` + * `38` -- :children_crossing: `:children_crossing:` + * `39` -- :chocolate_bar: `:chocolate_bar:` + * `40` -- :clap: `:clap:` + * `41` -- :cloud: `:cloud:` + * `42` -- :clubs: `:clubs:` + * `43` -- :cn: `:cn:` + * `44` -- :coffee: `:coffee:` + * `45` -- :construction: `:construction:` + * `46` -- :cookie: `:cookie:` + * `47` -- :copyright: `:copyright:` + * `48` -- :corn: `:corn:` + * `49` -- :cow: `:cow:` + * `50` -- :crescent_moon: `:crescent_moon:` + * `51` -- :crown: `:crown:` + * `52` -- :cry: `:cry:` + * `53` -- :crystal_ball: `:crystal_ball:` + * `54` -- :curly_loop: `:curly_loop:` + * `55` -- :dancers: `:dancers:` + * `56` -- :dash: `:dash:` + * `57` -- :de: `:de:` + * `58` -- :diamonds: `:diamonds:` + * `59` -- :dog: `:dog:` + * `60` -- :doughnut: `:doughnut:` + * `61` -- :dragon: `:dragon:` + * `62` -- :dvd: `:dvd:` + * `63` -- :ear: `:ear:` + * `64` -- :eggplant: `:eggplant:` + * `65` -- :elephant: `:elephant:` + * `66` -- :end: `:end:` + * `67` -- :envelope: `:envelope:` + * `68` -- :es: `:es:` + * `69` -- :eyes: `:eyes:` + * `70` -- :facepunch: `:facepunch:` + * `71` -- :family: `:family:` + * `72` -- :ferris_wheel: `:ferris_wheel:` + * `73` -- :finnadie: `:finnadie:` + * `74` -- :fire: `:fire:` + * `75` -- :fireworks: `:fireworks:` + * `76` -- :floppy_disk: `:floppy_disk:` + * `77` -- :football: `:football:` + * `78` -- :fork_and_knife: `:fork_and_knife:` + * `79` -- :four_leaf_clover: `:four_leaf_clover:` + * `80` -- :fr: `:fr:` + * `81` -- :fries: `:fries:` + * `82` -- :frog: `:frog:` + * `83` -- :fu: `:fu:` + * `84` -- :full_moon: `:full_moon:` + * `85` -- :game_die: `:game_die:` + * `86` -- :eu: `:eu:` + * `87` -- :gem: `:gem:` + * `88` -- :girl: `:girl:` + * `89` -- :goat: `:goat:` + * `90` -- :grimacing: `:grimacing:` + * `91` -- :grin: `:grin:` + * `92` -- :guardsman: `:guardsman:` + * `93` -- :guitar: `:guitar:` + * `94` -- :gun: `:gun:` + * `95` -- :hamburger: `:hamburger:` + * `96` -- :hammer: `:hammer:` + * `97` -- :hamster: `:hamster:` + * `98` -- :hear_no_evil: `:hear_no_evil:` + * `99` -- :heart: `:heart:` + * `100` -- :heart_eyes_cat: `:heart_eyes_cat:` + * `101` -- :hearts: `:hearts:` + * `102` -- :heavy_check_mark: `:heavy_check_mark:` + * `103` -- :moyai: `:moyai:` + * `104` -- :izakaya_lantern: `:izakaya_lantern:` + * `105` -- :helicopter: `:helicopter:` + * `106` -- :hocho: `:hocho:` + * `107` -- :honeybee: `:honeybee:` + * `108` -- :horse: `:horse:` + * `109` -- :horse_racing: `:horse_racing:` + * `110` -- :hourglass: `:hourglass:` + * `111` -- :house: `:house:` + * `112` -- :hurtrealbad: `:hurtrealbad:` + * `113` -- :icecream: `:icecream:` + * `114` -- :imp: `:imp:` + * `115` -- :it: `:it:` + * `116` -- :jack_o_lantern: `:jack_o_lantern:` + * `117` -- :japanese_goblin: `:japanese_goblin:` + * `118` -- :jp: `:jp:` + * `119` -- :key: `:key:` + * `120` -- :kiss: `:kiss:` + * `121` -- :kissing_cat: `:kissing_cat:` + * `122` -- :koala: `:koala:` + * `123` -- :kr: `:kr:` + * `124` -- :lemon: `:lemon:` + * `125` -- :lipstick: `:lipstick:` + * `126` -- :lock: `:lock:` + * `127` -- :lollipop: `:lollipop:` + * `128` -- :man: `:man:` + * `129` -- :maple_leaf: `:maple_leaf:` + * `130` -- :mask: `:mask:` + * `131` -- :metal: `:metal:` U+1F918 + * `132` -- :microscope: `:microscope:` + * `133` -- :moneybag: `:moneybag:` + * `134` -- :monkey: `:monkey:` + * `135` -- :mount_fuji: `:mount_fuji:` + * `136` -- :muscle: `:muscle:` + * `137` -- :mushroom: `:mushroom:` + * `138` -- :musical_keyboard: `:musical_keyboard:` + * `139` -- :musical_score: `:musical_score:` + * `140` -- :nail_care: `:nail_care:` + * `141` -- :new_moon: `:new_moon:` + * `142` -- :no_entry: `:no_entry:` + * `143` -- :nose: `:nose:` + * `144` -- :notes: `:notes:` + * `145` -- :nut_and_bolt: `:nut_and_bolt:` + * `146` -- :o: `:o:` + * `147` -- :ocean: `:ocean:` + * `148` -- :ok_hand: `:ok_hand:` + * `149` -- :on: `:on:` + * `150` -- :package: `:package:` + * `151` -- :palm_tree: `:palm_tree:` + * `152` -- :panda_face: `:panda_face:` + * `153` -- :paperclip: `:paperclip:` + * `154` -- :partly_sunny: `:partly_sunny:` + * `155` -- :passport_control: `:passport_control:` + * `156` -- :paw_prints: `:paw_prints:` + * `157` -- :peach: `:peach:` + * `158` -- :penguin: `:penguin:` + * `159` -- :phone: `:phone:` + * `160` -- :pig: `:pig:` + * `161` -- :pill: `:pill:` + * `162` -- :pineapple: `:pineapple:` + * `163` -- :pizza: `:pizza:` + * `164` -- :point_left: `:point_left:` + * `165` -- :point_right: `:point_right:` + * `166` -- :poop: `:poop:` + * `167` -- :poultry_leg: `:poultry_leg:` + * `168` -- :pray: `:pray:` + * `169` -- :princess: `:princess:` + * `170` -- :purse: `:purse:` + * `171` -- :pushpin: `:pushpin:` + * `172` -- :rabbit: `:rabbit:` + * `173` -- :rainbow: `:rainbow:` + * `174` -- :raised_hand: `:raised_hand:` + * `175` -- :recycle: `:recycle:` + * `176` -- :red_car: `:red_car:` + * `177` -- :registered: `:registered:` + * `178` -- :ribbon: `:ribbon:` + * `179` -- :rice: `:rice:` + * `180` -- :rocket: `:rocket:` + * `181` -- :roller_coaster: `:roller_coaster:` + * `182` -- :rooster: `:rooster:` + * `183` -- :ru: `:ru:` + * `184` -- :sailboat: `:sailboat:` + * `185` -- :santa: `:santa:` + * `186` -- :satellite: `:satellite:` + * `187` -- :satisfied: `:satisfied:` + * `188` -- :saxophone: `:saxophone:` + * `189` -- :scissors: `:scissors:` + * `190` -- :see_no_evil: `:see_no_evil:` + * `191` -- :sheep: `:sheep:` + * `192` -- :shell: `:shell:` + * `193` -- :shoe: `:shoe:` + * `194` -- :ski: `:ski:` + * `195` -- :skull: `:skull:` + * `196` -- :sleepy: `:sleepy:` + * `197` -- :smile: `:smile:` + * `198` -- :smiley_cat: `:smiley_cat:` + * `199` -- :smirk: `:smirk:` + * `200` -- :smoking: `:smoking:` + * `201` -- :snail: `:snail:` + * `202` -- :snake: `:snake:` + * `203` -- :snowflake: `:snowflake:` + * `204` -- :soccer: `:soccer:` + * `205` -- :soon: `:soon:` + * `206` -- :space_invader: `:space_invader:` + * `207` -- :spades: `:spades:` + * `208` -- :speak_no_evil: `:speak_no_evil:` + * `209` -- :star: `:star:` + * `210` -- :stars: `:stars:` + * `211` -- :statue_of_liberty: `:statue_of_liberty:` + * `212` -- :steam_locomotive: `:steam_locomotive:` + * `213` -- :sunflower: `:sunflower:` + * `214` -- :sunglasses: `:sunglasses:` + * `215` -- :sunny: `:sunny:` + * `216` -- :sunrise: `:sunrise:` + * `217` -- :surfer: `:surfer:` + * `218` -- :swimmer: `:swimmer:` + * `219` -- :syringe: `:syringe:` + * `220` -- :tada: `:tada:` + * `221` -- :tangerine: `:tangerine:` + * `222` -- :taxi: `:taxi:` + * `223` -- :tennis: `:tennis:` + * `224` -- :tent: `:tent:` + * `225` -- :thought_balloon: `:thought_balloon:` + * `226` -- :tm: `:tm:` + * `227` -- :toilet: `:toilet:` + * `228` -- :tongue: `:tongue:` + * `229` -- :tophat: `:tophat:` + * `230` -- :tractor: `:tractor:` + * `231` -- :trolleybus: `:trolleybus:` + * `232` -- :trollface: `:trollface:` + * `233` -- :trophy: `:trophy:` + * `234` -- :trumpet: `:trumpet:` + * `235` -- :turtle: `:turtle:` + * `236` -- :two_men_holding_hands: `:two_men_holding_hands:` + * `237` -- :two_women_holding_hands: `:two_women_holding_hands:` + * `238` -- :uk: `:uk:` + * `239` -- :umbrella: `:umbrella:` + * `240` -- :unlock: `:unlock:` + * `241` -- :us: `:us:` + * `242` -- :v: `:v:` + * `243` -- :vhs: `:vhs:` + * `244` -- :violin: `:violin:` + * `245` -- :warning: `:warning:` + * `246` -- :watermelon: `:watermelon:` + * `247` -- :wave: `:wave:` + * `248` -- :wavy_dash: `:wavy_dash:` + * `249` -- :wc: `:wc:` + * `250` -- :wheelchair: `:wheelchair:` + * `251` -- :woman: `:woman:` + * `252` -- :x: `:x:` + * `253` -- :yum: `:yum:` + * `254` -- :zap: `:zap:` + * `255` -- :zzz: `:zzz:` diff --git a/emoji/map.go b/emoji/map.go index dea7b68..50c7b29 100644 --- a/emoji/map.go +++ b/emoji/map.go @@ -1,5 +1,7 @@ package emoji +import "strings" + // Map returns the emoji at the provided position. // This list is from 0-255 func Map(b byte) Words { @@ -25,3 +27,13 @@ type VersionedMap struct { // Words are a set of options to represent an emoji. // Possible options could be the ":colon_notion:" or a "U+26CF" style codepoint. type Words []string + +// IsColonNotation checks for whether a word is the :colon_notion: of emoji +func IsColonNotation(word string) bool { + return strings.HasPrefix(word, ":") && strings.HasSuffix(word, ":") +} + +// IsCodepoint checks for whether a word is the "U+1234" codepoint style of emoji +func IsCodepoint(word string) bool { + return strings.HasPrefix(strings.ToUpper(word), "U+") +} diff --git a/emoji/map_gen.go b/emoji/map_gen.go new file mode 100644 index 0000000..5064e04 --- /dev/null +++ b/emoji/map_gen.go @@ -0,0 +1,525 @@ + +// THIS FILE IS GENERATED. DO NOT EDIT. + +package emoji + +func init() { + mapGen = VersionedMap{ + Description: "This ordered list of emojiwords is the conventional order for the practice of conveying checksums with emoji. Each position provides the alternative for resolving the desired emoji.", + Version: "draft+1", + EmojiWords: []Words{ + Words{ ":+1:", + }, + Words{ ":8ball:", + }, + Words{ ":airplane:", + }, + Words{ ":alien:", + }, + Words{ ":anchor:", + }, + Words{ ":angel:", + }, + Words{ ":angry:", + }, + Words{ ":ant:", + }, + Words{ ":apple:", + }, + Words{ ":art:", + }, + Words{ ":baby:", + }, + Words{ ":baby_bottle:", + }, + Words{ ":back:", + }, + Words{ ":bamboo:", + }, + Words{ ":banana:", + }, + Words{ ":barber:", + }, + Words{ ":bathtub:", + }, + Words{ ":beer:", + }, + Words{ ":bell:", + }, + Words{ ":bicyclist:", + }, + Words{ ":bird:", + }, + Words{ ":birthday:", + }, + Words{ ":blossom:", + }, + Words{ ":blue_car:", + }, + Words{ ":boar:", + }, + Words{ ":bomb:", + }, + Words{ ":boom:", + }, + Words{ ":bow:", + }, + Words{ ":boy:", + }, + Words{ ":broken_heart:", + }, + Words{ ":bulb:", + }, + Words{ ":bus:", + }, + Words{ ":cactus:", + }, + Words{ ":calendar:", + }, + Words{ ":camera:", + }, + Words{ ":candy:", + }, + Words{ ":cat:", + }, + Words{ ":cherries:", + }, + Words{ ":children_crossing:", + }, + Words{ ":chocolate_bar:", + }, + Words{ ":clap:", + }, + Words{ ":cloud:", + }, + Words{ ":clubs:", + }, + Words{ ":cn:", + }, + Words{ ":coffee:", + }, + Words{ ":construction:", + }, + Words{ ":cookie:", + }, + Words{ ":copyright:", + }, + Words{ ":corn:", + }, + Words{ ":cow:", + }, + Words{ ":crescent_moon:", + }, + Words{ ":crown:", + }, + Words{ ":cry:", + }, + Words{ ":crystal_ball:", + }, + Words{ ":curly_loop:", + }, + Words{ ":dancers:", + }, + Words{ ":dash:", + }, + Words{ ":de:", + }, + Words{ ":diamonds:", + }, + Words{ ":dog:", + }, + Words{ ":doughnut:", + }, + Words{ ":dragon:", + }, + Words{ ":dvd:", + }, + Words{ ":ear:", + }, + Words{ ":eggplant:", + }, + Words{ ":elephant:", + }, + Words{ ":end:", + }, + Words{ ":envelope:", + }, + Words{ ":es:", + }, + Words{ ":eyes:", + }, + Words{ ":facepunch:", + }, + Words{ ":family:", + }, + Words{ ":ferris_wheel:", + }, + Words{ ":finnadie:", + }, + Words{ ":fire:", + }, + Words{ ":fireworks:", + }, + Words{ ":floppy_disk:", + }, + Words{ ":football:", + }, + Words{ ":fork_and_knife:", + }, + Words{ ":four_leaf_clover:", + }, + Words{ ":fr:", + }, + Words{ ":fries:", + }, + Words{ ":frog:", + }, + Words{ ":fu:", + }, + Words{ ":full_moon:", + }, + Words{ ":game_die:", + }, + Words{ ":eu:", + }, + Words{ ":gem:", + }, + Words{ ":girl:", + }, + Words{ ":goat:", + }, + Words{ ":grimacing:", + }, + Words{ ":grin:", + }, + Words{ ":guardsman:", + }, + Words{ ":guitar:", + }, + Words{ ":gun:", + }, + Words{ ":hamburger:", + }, + Words{ ":hammer:", + }, + Words{ ":hamster:", + }, + Words{ ":hear_no_evil:", + }, + Words{ ":heart:", + }, + Words{ ":heart_eyes_cat:", + }, + Words{ ":hearts:", + }, + Words{ ":heavy_check_mark:", + }, + Words{ ":moyai:", + }, + Words{ ":izakaya_lantern:", + }, + Words{ ":helicopter:", + }, + Words{ ":hocho:", + }, + Words{ ":honeybee:", + }, + Words{ ":horse:", + }, + Words{ ":horse_racing:", + }, + Words{ ":hourglass:", + }, + Words{ ":house:", + }, + Words{ ":hurtrealbad:", + }, + Words{ ":icecream:", + }, + Words{ ":imp:", + }, + Words{ ":it:", + }, + Words{ ":jack_o_lantern:", + }, + Words{ ":japanese_goblin:", + }, + Words{ ":jp:", + }, + Words{ ":key:", + }, + Words{ ":kiss:", + }, + Words{ ":kissing_cat:", + }, + Words{ ":koala:", + }, + Words{ ":kr:", + }, + Words{ ":lemon:", + }, + Words{ ":lipstick:", + }, + Words{ ":lock:", + }, + Words{ ":lollipop:", + }, + Words{ ":man:", + }, + Words{ ":maple_leaf:", + }, + Words{ ":mask:", + }, + Words{ ":metal:","U+1F918", + }, + Words{ ":microscope:", + }, + Words{ ":moneybag:", + }, + Words{ ":monkey:", + }, + Words{ ":mount_fuji:", + }, + Words{ ":muscle:", + }, + Words{ ":mushroom:", + }, + Words{ ":musical_keyboard:", + }, + Words{ ":musical_score:", + }, + Words{ ":nail_care:", + }, + Words{ ":new_moon:", + }, + Words{ ":no_entry:", + }, + Words{ ":nose:", + }, + Words{ ":notes:", + }, + Words{ ":nut_and_bolt:", + }, + Words{ ":o:", + }, + Words{ ":ocean:", + }, + Words{ ":ok_hand:", + }, + Words{ ":on:", + }, + Words{ ":package:", + }, + Words{ ":palm_tree:", + }, + Words{ ":panda_face:", + }, + Words{ ":paperclip:", + }, + Words{ ":partly_sunny:", + }, + Words{ ":passport_control:", + }, + Words{ ":paw_prints:", + }, + Words{ ":peach:", + }, + Words{ ":penguin:", + }, + Words{ ":phone:", + }, + Words{ ":pig:", + }, + Words{ ":pill:", + }, + Words{ ":pineapple:", + }, + Words{ ":pizza:", + }, + Words{ ":point_left:", + }, + Words{ ":point_right:", + }, + Words{ ":poop:", + }, + Words{ ":poultry_leg:", + }, + Words{ ":pray:", + }, + Words{ ":princess:", + }, + Words{ ":purse:", + }, + Words{ ":pushpin:", + }, + Words{ ":rabbit:", + }, + Words{ ":rainbow:", + }, + Words{ ":raised_hand:", + }, + Words{ ":recycle:", + }, + Words{ ":red_car:", + }, + Words{ ":registered:", + }, + Words{ ":ribbon:", + }, + Words{ ":rice:", + }, + Words{ ":rocket:", + }, + Words{ ":roller_coaster:", + }, + Words{ ":rooster:", + }, + Words{ ":ru:", + }, + Words{ ":sailboat:", + }, + Words{ ":santa:", + }, + Words{ ":satellite:", + }, + Words{ ":satisfied:", + }, + Words{ ":saxophone:", + }, + Words{ ":scissors:", + }, + Words{ ":see_no_evil:", + }, + Words{ ":sheep:", + }, + Words{ ":shell:", + }, + Words{ ":shoe:", + }, + Words{ ":ski:", + }, + Words{ ":skull:", + }, + Words{ ":sleepy:", + }, + Words{ ":smile:", + }, + Words{ ":smiley_cat:", + }, + Words{ ":smirk:", + }, + Words{ ":smoking:", + }, + Words{ ":snail:", + }, + Words{ ":snake:", + }, + Words{ ":snowflake:", + }, + Words{ ":soccer:", + }, + Words{ ":soon:", + }, + Words{ ":space_invader:", + }, + Words{ ":spades:", + }, + Words{ ":speak_no_evil:", + }, + Words{ ":star:", + }, + Words{ ":stars:", + }, + Words{ ":statue_of_liberty:", + }, + Words{ ":steam_locomotive:", + }, + Words{ ":sunflower:", + }, + Words{ ":sunglasses:", + }, + Words{ ":sunny:", + }, + Words{ ":sunrise:", + }, + Words{ ":surfer:", + }, + Words{ ":swimmer:", + }, + Words{ ":syringe:", + }, + Words{ ":tada:", + }, + Words{ ":tangerine:", + }, + Words{ ":taxi:", + }, + Words{ ":tennis:", + }, + Words{ ":tent:", + }, + Words{ ":thought_balloon:", + }, + Words{ ":tm:", + }, + Words{ ":toilet:", + }, + Words{ ":tongue:", + }, + Words{ ":tophat:", + }, + Words{ ":tractor:", + }, + Words{ ":trolleybus:", + }, + Words{ ":trollface:", + }, + Words{ ":trophy:", + }, + Words{ ":trumpet:", + }, + Words{ ":turtle:", + }, + Words{ ":two_men_holding_hands:", + }, + Words{ ":two_women_holding_hands:", + }, + Words{ ":uk:", + }, + Words{ ":umbrella:", + }, + Words{ ":unlock:", + }, + Words{ ":us:", + }, + Words{ ":v:", + }, + Words{ ":vhs:", + }, + Words{ ":violin:", + }, + Words{ ":warning:", + }, + Words{ ":watermelon:", + }, + Words{ ":wave:", + }, + Words{ ":wavy_dash:", + }, + Words{ ":wc:", + }, + Words{ ":wheelchair:", + }, + Words{ ":woman:", + }, + Words{ ":x:", + }, + Words{ ":yum:", + }, + Words{ ":zap:", + }, + Words{ ":zzz:", + }, + }, + } +} diff --git a/emoji/map_gen.tmpl b/emoji/map_gen.tmpl deleted file mode 100644 index 18517f2..0000000 --- a/emoji/map_gen.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -// THIS FILE IS GENERATED. DO NOT EDIT. - -package emoji - -func init() { - mapGen = VersionedMap{ - Description: "{{.Description}}", - Version: "{{.Version}}", - EmojiWords: []Words{ {{- range .EmojiWords }} - Words{ {{ range . -}} - "{{- . }}",{{- end }} - },{{- end }} - }, - } -} diff --git a/emoji/map_json.go b/emoji/map_json.go index b97d2fa..732fe8c 100644 --- a/emoji/map_json.go +++ b/emoji/map_json.go @@ -33,7 +33,16 @@ func main() { } defer output.Close() - mapGoTemp := template.Must(template.ParseFiles(*flTemplate)) + //mapGoTemp := template.Must(template.ParseFiles(*flTemplate)) + funcMap := template.FuncMap{ + "IsColonNotation": emoji.IsColonNotation, + "IsCodepoint": emoji.IsCodepoint, + } + + mapGoTemp, err := template.New("").Funcs(funcMap).Parse(tmpl[*flTemplate]) + if err != nil { + log.Fatal(err) + } if err := mapGoTemp.Execute(output, vm); err != nil { log.Fatal(err) } @@ -42,5 +51,47 @@ func main() { var ( flInput = flag.String("in", "emojimap.json", "json input") flOutput = flag.String("out", "map_gen.go", "golang output") - flTemplate = flag.String("template", "map_gen.tmpl", "template of golang source to use") + flTemplate = flag.String("template", "map_gen", "template to use (map_gen or markdown_gen)") ) + +var tmpl = map[string]string{ + "map_gen": ` +// THIS FILE IS GENERATED. DO NOT EDIT. + +package emoji + +func init() { + mapGen = VersionedMap{ + Description: "{{.Description}}", + Version: "{{.Version}}", + EmojiWords: []Words{ {{- range .EmojiWords }} + Words{ {{ range . -}} + "{{- . }}",{{- end }} + },{{- end }} + }, + } +} +`, + "markdown_gen": ` +## Emoji Map list + +_THIS FILE IS GENERATED. DO NOT EDIT._ + +This is for "pretty" viewing purposes. +To view the functional document, see [emojimap.json](./emojimap.json). + +### Description + +{{ .Description }} + +### Version + +{{ .Version }} + +### List + +{{- range $index, $words := .EmojiWords }} + * ` + "`{{ $index }}`" + ` -- {{ range $words }} {{- if IsColonNotation . -}} {{ . }} ` + "`{{ . }}`" + ` {{- else }} {{.}} {{- end }}{{- end }} +{{- end }} +`, +} diff --git a/emoji/markdown_gen.tmpl b/emoji/markdown_gen.tmpl deleted file mode 100644 index fb69953..0000000 --- a/emoji/markdown_gen.tmpl +++ /dev/null @@ -1,20 +0,0 @@ -## Emoji Map list - -_THIS FILE IS GENERATED. DO NOT EDIT._ - -This is for "pretty" viewing purposes. -To view the functional document, see [emojimap.json](./emojimap.json). - -### Description - -{{ .Description }} - -### Version - -{{ .Version }} - -### List - -{{- range $index, $words := .EmojiWords }} - * `{{ $index }}` -- {{ range $words }} {{ . }} `{{ . }}` {{- end }} -{{- end }}