diff --git a/awk/emoji.awk b/awk/emoji.awk index 2324174..d27f212 100644 --- a/awk/emoji.awk +++ b/awk/emoji.awk @@ -1,831 +1,15 @@ BEGIN { - map[":+1:"] = "๐" - map[":100:"] = "๐ฏ" - map[":1234:"] = "๐ข" - map[":8ball:"] = "๐ฑ" - map[":a:"] = "๐ ฐ๏ธ" - map[":ab:"] = "๐" - map[":abc:"] = "๐ค" - map[":abcd:"] = "๐ก" - map[":accept:"] = "๐" - map[":aerial_tramway:"] = "๐ก" - map[":airplane:"] = "โ๏ธ" - map[":alarm_clock:"] = "โฐ" - map[":alien:"] = "๐ฝ" - map[":ambulance:"] = "๐" - map[":anchor:"] = "โ" - map[":angel:"] = "๐ผ" - map[":anger:"] = "๐ข" - map[":angry:"] = "๐ " - map[":anguished:"] = "๐ง" - map[":ant:"] = "๐" - map[":apple:"] = "๐" - map[":aquarius:"] = "โ" - map[":aries:"] = "โ" - map[":arrow_backward:"] = "โ๏ธ" - map[":arrow_double_down:"] = "โฌ" - map[":arrow_double_up:"] = "โซ" - map[":arrow_down:"] = "โฌ๏ธ" - map[":arrow_down_small:"] = "๐ฝ" - map[":arrow_forward:"] = "โถ๏ธ" - map[":arrow_heading_down:"] = "โคต๏ธ" - map[":arrow_heading_up:"] = "โคด๏ธ" - map[":arrow_left:"] = "โฌ ๏ธ" - map[":arrow_lower_left:"] = "โ๏ธ" - map[":arrow_lower_right:"] = "โ๏ธ" - map[":arrow_right:"] = "โก๏ธ" - map[":arrow_right_hook:"] = "โช๏ธ" - map[":arrow_up:"] = "โฌ๏ธ" - map[":arrow_up_down:"] = "โ๏ธ" - map[":arrow_up_small:"] = "๐ผ" - map[":arrow_upper_left:"] = "โ๏ธ" - map[":arrow_upper_right:"] = "โ๏ธ" - map[":arrows_clockwise:"] = "๐" - map[":arrows_counterclockwise:"] = "๐" - map[":art:"] = "๐จ" - map[":articulated_lorry:"] = "๐" - map[":astonished:"] = "๐ฒ" - map[":atm:"] = "๐ง" - map[":b:"] = "๐ ฑ๏ธ" - map[":baby:"] = "๐ถ" - map[":baby_bottle:"] = "๐ผ" - map[":baby_chick:"] = "๐ค" - map[":baby_symbol:"] = "๐ผ" - map[":baggage_claim:"] = "๐" - map[":balloon:"] = "๐" - map[":ballot_box_with_check:"] = "โ๏ธ" - map[":bamboo:"] = "๐" - map[":banana:"] = "๐" - map[":bangbang:"] = "โผ๏ธ" - map[":bank:"] = "๐ฆ" - map[":bar_chart:"] = "๐" - map[":barber:"] = "๐" - map[":baseball:"] = "โพ" - map[":basketball:"] = "๐" - map[":bath:"] = "๐" - map[":bathtub:"] = "๐" - map[":battery:"] = "๐" - map[":bear:"] = "๐ป" - map[":beer:"] = "๐บ" - map[":beers:"] = "๐ป" - map[":beetle:"] = "๐ชฒ" - map[":beginner:"] = "๐ฐ" - map[":bell:"] = "๐" - map[":bento:"] = "๐ฑ" - map[":bicyclist:"] = "๐ด" - map[":bike:"] = "๐ฒ" - map[":bikini:"] = "๐" - map[":bird:"] = "๐ฆ" - map[":birthday:"] = "๐" - map[":black_circle:"] = "โซ" - map[":black_joker:"] = "๐" - map[":black_nib:"] = "โ๏ธ" - map[":black_square_button:"] = "๐ฒ" - map[":blossom:"] = "๐ผ" - map[":blowfish:"] = "๐ก" - map[":blue_book:"] = "๐" - map[":blue_car:"] = "๐" - map[":blue_heart:"] = "๐" - map[":blush:"] = "๐" - map[":boar:"] = "๐" - map[":boat:"] = "โต" - map[":bomb:"] = "๐ฃ" - map[":book:"] = "๐" - map[":bookmark:"] = "๐" - map[":bookmark_tabs:"] = "๐" - map[":books:"] = "๐" - map[":boom:"] = "๐ฅ" - map[":boot:"] = "๐ข" - map[":bouquet:"] = "๐" - map[":bow:"] = "๐" - map[":bowling:"] = "๐ณ" - map[":boy:"] = "๐ฆ" - map[":bread:"] = "๐" - map[":bride_with_veil:"] = "๐ฐโโ๏ธ" - map[":bridge_at_night:"] = "๐" - map[":briefcase:"] = "๐ผ" - map[":broken_heart:"] = "๐" - map[":bug:"] = "๐" - map[":bulb:"] = "๐ก" - map[":bullettrain_front:"] = "๐ " - map[":bullettrain_side:"] = "๐" - map[":bus:"] = "๐" - map[":busstop:"] = "๐" - map[":bust_in_silhouette:"] = "๐ค" - map[":busts_in_silhouette:"] = "๐ฅ" - map[":cactus:"] = "๐ต" - map[":cake:"] = "๐ฐ" - map[":calendar:"] = "๐" - map[":calling:"] = "๐ฒ" - map[":camel:"] = "๐ซ" - map[":camera:"] = "๐ท" - map[":cancer:"] = "โ" - map[":candy:"] = "๐ฌ" - map[":capital_abcd:"] = "๐ " - map[":capricorn:"] = "โ" - map[":car:"] = "๐" - map[":card_index:"] = "๐" - map[":carousel_horse:"] = "๐ " - map[":cat2:"] = "๐" - map[":cat:"] = "๐ฑ" - map[":cd:"] = "๐ฟ" - map[":chart:"] = "๐น" - map[":chart_with_downwards_trend:"] = "๐" - map[":chart_with_upwards_trend:"] = "๐" - map[":checkered_flag:"] = "๐" - map[":cherries:"] = "๐" - map[":cherry_blossom:"] = "๐ธ" - map[":chestnut:"] = "๐ฐ" - map[":chicken:"] = "๐" - map[":children_crossing:"] = "๐ธ" - map[":chocolate_bar:"] = "๐ซ" - map[":christmas_tree:"] = "๐" - map[":church:"] = "โช" - map[":cinema:"] = "๐ฆ" - map[":circus_tent:"] = "๐ช" - map[":city_sunrise:"] = "๐" - map[":city_sunset:"] = "๐" - map[":cl:"] = "๐" - map[":clap:"] = "๐" - map[":clapper:"] = "๐ฌ" - map[":clipboard:"] = "๐" - map[":clock1030:"] = "๐ฅ" - map[":clock10:"] = "๐" - map[":clock1130:"] = "๐ฆ" - map[":clock11:"] = "๐" - map[":clock1230:"] = "๐ง" - map[":clock12:"] = "๐" - map[":clock130:"] = "๐" - map[":clock1:"] = "๐" - map[":clock230:"] = "๐" - map[":clock2:"] = "๐" - map[":clock330:"] = "๐" - map[":clock3:"] = "๐" - map[":clock430:"] = "๐" - map[":clock4:"] = "๐" - map[":clock530:"] = "๐ " - map[":clock5:"] = "๐" - map[":clock630:"] = "๐ก" - map[":clock6:"] = "๐" - map[":clock730:"] = "๐ข" - map[":clock7:"] = "๐" - map[":clock830:"] = "๐ฃ" - map[":clock8:"] = "๐" - map[":clock930:"] = "๐ค" - map[":clock9:"] = "๐" - map[":closed_book:"] = "๐" - map[":closed_lock_with_key:"] = "๐" - map[":closed_umbrella:"] = "๐" - map[":cloud:"] = "โ๏ธ" - map[":clubs:"] = "โฃ๏ธ" - map[":cn:"] = "๐จ๐ณ" - map[":cocktail:"] = "๐ธ" - map[":coffee:"] = "โ" - map[":cold_sweat:"] = "๐ฐ" - map[":computer:"] = "๐ป" - map[":confetti_ball:"] = "๐" - map[":confounded:"] = "๐" - map[":confused:"] = "๐" - map[":congratulations:"] = "ใ๏ธ" - map[":construction:"] = "๐ง" - map[":construction_worker:"] = "๐ท" - map[":convenience_store:"] = "๐ช" - map[":cookie:"] = "๐ช" - map[":cool:"] = "๐" - map[":cop:"] = "๐ฎ" - map[":copyright:"] = "ยฉ๏ธ" - map[":corn:"] = "๐ฝ" - map[":couple:"] = "๐ซ" - map[":couple_with_heart:"] = "๐" - map[":couplekiss:"] = "๐" - map[":cow2:"] = "๐" - map[":cow:"] = "๐ฎ" - map[":credit_card:"] = "๐ณ" - map[":crocodile:"] = "๐" - map[":crossed_flags:"] = "๐" - map[":crown:"] = "๐" - map[":cry:"] = "๐ข" - map[":crying_cat_face:"] = "๐ฟ" - map[":crystal_ball:"] = "๐ฎ" - map[":cupid:"] = "๐" - map[":curly_loop:"] = "โฐ" - map[":currency_exchange:"] = "๐ฑ" - map[":curry:"] = "๐" - map[":custard:"] = "๐ฎ" - map[":customs:"] = "๐" - map[":cyclone:"] = "๐" - map[":dancer:"] = "๐" - map[":dancers:"] = "๐ฏ" - map[":dango:"] = "๐ก" - map[":dart:"] = "๐ฏ" - map[":dash:"] = "๐จ" - map[":date:"] = "๐ " - map[":de:"] = "๐ฉ๐ช" - map[":deciduous_tree:"] = "๐ณ" - map[":department_store:"] = "๐ฌ" - map[":diamond_shape_with_a_dot_inside:"] = "๐ " - map[":diamonds:"] = "โฆ๏ธ" - map[":disappointed:"] = "๐" - map[":disappointed_relieved:"] = "๐ฅ" - map[":dizzy:"] = "๐ซ" - map[":dizzy_face:"] = "๐ต" - map[":do_not_litter:"] = "๐ฏ" - map[":dog2:"] = "๐" - map[":dog:"] = "๐ถ" - map[":dollar:"] = "๐ต" - map[":dolls:"] = "๐" - map[":dolphin:"] = "๐ฌ" - map[":door:"] = "๐ช" - map[":doughnut:"] = "๐ฉ" - map[":dragon:"] = "๐" - map[":dragon_face:"] = "๐ฒ" - map[":dress:"] = "๐" - map[":dromedary_camel:"] = "๐ช" - map[":droplet:"] = "๐ง" - map[":dvd:"] = "๐" - map[":ear:"] = "๐" - map[":ear_of_rice:"] = "๐พ" - map[":earth_africa:"] = "๐" - map[":earth_americas:"] = "๐" - map[":earth_asia:"] = "๐" - map[":egg:"] = "๐ฅ" - map[":eggplant:"] = "๐" - map[":eight:"] = "8๏ธโฃ" - map[":eight_pointed_black_star:"] = "โด๏ธ" - map[":eight_spoked_asterisk:"] = "โณ๏ธ" - map[":electric_plug:"] = "๐" - map[":elephant:"] = "๐" - map[":email:"] = "๐ง" - map[":end:"] = "๐" - map[":envelope:"] = "โ๏ธ" - map[":es:"] = "๐ช๐ธ" - map[":euro:"] = "๐ถ" - map[":european_castle:"] = "๐ฐ" - map[":european_post_office:"] = "๐ค" - map[":evergreen_tree:"] = "๐ฒ" - map[":exclamation:"] = "โ" - map[":expressionless:"] = "๐" - map[":eyeglasses:"] = "๐" - map[":eyes:"] = "๐" - map[":factory:"] = "๐ญ" - map[":fallen_leaf:"] = "๐" - map[":family:"] = "๐ช" - map[":fast_forward:"] = "โฉ" - map[":fax:"] = "๐ " - map[":fearful:"] = "๐จ" - map[":feet:"] = "๐พ" - map[":ferris_wheel:"] = "๐ก" - map[":file_folder:"] = "๐" - map[":fire:"] = "๐ฅ" - map[":fire_engine:"] = "๐" - map[":fireworks:"] = "๐" - map[":first_quarter_moon:"] = "๐" - map[":first_quarter_moon_with_face:"] = "๐" - map[":fish:"] = "๐" - map[":fish_cake:"] = "๐ฅ" - map[":fishing_pole_and_fish:"] = "๐ฃ" - map[":fist:"] = "โ" - map[":five:"] = "5๏ธโฃ" - map[":flags:"] = "๐" - map[":flashlight:"] = "๐ฆ" - map[":floppy_disk:"] = "๐พ" - map[":flower_playing_cards:"] = "๐ด" - map[":flushed:"] = "๐ณ" - map[":foggy:"] = "๐" - map[":football:"] = "๐" - map[":fork_and_knife:"] = "๐ด" - map[":fountain:"] = "โฒ" - map[":four:"] = "4๏ธโฃ" - map[":four_leaf_clover:"] = "๐" - map[":fr:"] = "๐ซ๐ท" - map[":free:"] = "๐" - map[":fried_shrimp:"] = "๐ค" - map[":fries:"] = "๐" - map[":frog:"] = "๐ธ" - map[":frowning:"] = "๐ฆ" - map[":fuelpump:"] = "โฝ" - map[":full_moon:"] = "๐" - map[":full_moon_with_face:"] = "๐" - map[":game_die:"] = "๐ฒ" - map[":gem:"] = "๐" - map[":gemini:"] = "โ" - map[":ghost:"] = "๐ป" - map[":gift:"] = "๐" - map[":gift_heart:"] = "๐" - map[":girl:"] = "๐ง" - map[":globe_with_meridians:"] = "๐" - map[":goat:"] = "๐" - map[":golf:"] = "โณ" - map[":grapes:"] = "๐" - map[":green_apple:"] = "๐" - map[":green_book:"] = "๐" - map[":green_heart:"] = "๐" - map[":grey_exclamation:"] = "โ" - map[":grey_question:"] = "โ" - map[":grimacing:"] = "๐ฌ" - map[":grin:"] = "๐" - map[":grinning:"] = "๐" - map[":guardsman:"] = "๐โโ๏ธ" - map[":guitar:"] = "๐ธ" - map[":gun:"] = "๐ซ" - map[":haircut:"] = "๐" - map[":hamburger:"] = "๐" - map[":hammer:"] = "๐จ" - map[":hamster:"] = "๐น" - map[":handbag:"] = "๐" - map[":hankey:"] = "๐ฉ" - map[":hash:"] = "#๏ธโฃ" - map[":hatched_chick:"] = "๐ฅ" - map[":hatching_chick:"] = "๐ฃ" - map[":headphones:"] = "๐ง" - map[":hear_no_evil:"] = "๐" - map[":heart:"] = "โค๏ธ" - map[":heart_decoration:"] = "๐" - map[":heart_eyes:"] = "๐" - map[":heart_eyes_cat:"] = "๐ป" - map[":heartbeat:"] = "๐" - map[":hearts:"] = "โฅ๏ธ" - map[":heavy_check_mark:"] = "โ๏ธ" - map[":heavy_division_sign:"] = "โ" - map[":heavy_dollar_sign:"] = "๐ฒ" - map[":heavy_minus_sign:"] = "โ" - map[":heavy_multiplication_x:"] = "โ๏ธ" - map[":heavy_plus_sign:"] = "โ" - map[":helicopter:"] = "๐" - map[":herb:"] = "๐ฟ" - map[":hibiscus:"] = "๐บ" - map[":high_brightness:"] = "๐" - map[":high_heel:"] = "๐ " - map[":honey_pot:"] = "๐ฏ" - map[":horse:"] = "๐ด" - map[":horse_racing:"] = "๐" - map[":hospital:"] = "๐ฅ" - map[":hotel:"] = "๐จ" - map[":hotsprings:"] = "โจ๏ธ" - map[":hourglass:"] = "โ" - map[":hourglass_flowing_sand:"] = "โณ" - map[":house:"] = "๐ " - map[":house_with_garden:"] = "๐ก" - map[":hushed:"] = "๐ฏ" - map[":ice_cream:"] = "๐จ" - map[":icecream:"] = "๐ฆ" - map[":id:"] = "๐" - map[":ideograph_advantage:"] = "๐" - map[":imp:"] = "๐ฟ" - map[":inbox_tray:"] = "๐ฅ" - map[":incoming_envelope:"] = "๐จ" - map[":information_desk_person:"] = "๐" - map[":information_source:"] = "โน๏ธ" - map[":innocent:"] = "๐" - map[":interrobang:"] = "โ๏ธ" - map[":iphone:"] = "๐ฑ" - map[":it:"] = "๐ฎ๐น" - map[":izakaya_lantern:"] = "๐ฎ" - map[":jack_o_lantern:"] = "๐" - map[":japan:"] = "๐พ" - map[":japanese_castle:"] = "๐ฏ" - map[":japanese_goblin:"] = "๐บ" - map[":japanese_ogre:"] = "๐น" - map[":jeans:"] = "๐" - map[":joy:"] = "๐" - map[":joy_cat:"] = "๐น" - map[":jp:"] = "๐ฏ๐ต" - map[":key:"] = "๐" - map[":keycap_ten:"] = "๐" - map[":kimono:"] = "๐" - map[":kiss:"] = "๐" - map[":kissing:"] = "๐" - map[":kissing_cat:"] = "๐ฝ" - map[":kissing_closed_eyes:"] = "๐" - map[":kissing_heart:"] = "๐" - map[":kissing_smiling_eyes:"] = "๐" - map[":koala:"] = "๐จ" - map[":koko:"] = "๐" - map[":kr:"] = "๐ฐ๐ท" - map[":large_blue_diamond:"] = "๐ท" - map[":large_orange_diamond:"] = "๐ถ" - map[":last_quarter_moon:"] = "๐" - map[":last_quarter_moon_with_face:"] = "๐" - map[":laughing:"] = "๐" - map[":leaves:"] = "๐" - map[":ledger:"] = "๐" - map[":left_luggage:"] = "๐ " - map[":left_right_arrow:"] = "โ๏ธ" - map[":leftwards_arrow_with_hook:"] = "โฉ๏ธ" - map[":lemon:"] = "๐" - map[":leo:"] = "โ" - map[":leopard:"] = "๐" - map[":libra:"] = "โ" - map[":light_rail:"] = "๐" - map[":link:"] = "๐" - map[":lips:"] = "๐" - map[":lipstick:"] = "๐" - map[":lock:"] = "๐" - map[":lock_with_ink_pen:"] = "๐" - map[":lollipop:"] = "๐ญ" - map[":loop:"] = "โฟ" - map[":loudspeaker:"] = "๐ข" - map[":love_hotel:"] = "๐ฉ" - map[":love_letter:"] = "๐" - map[":low_brightness:"] = "๐ " - map[":m:"] = "โ๏ธ" - map[":mag:"] = "๐" - map[":mag_right:"] = "๐" - map[":mahjong:"] = "๐" - map[":mailbox:"] = "๐ซ" - map[":mailbox_closed:"] = "๐ช" - map[":mailbox_with_mail:"] = "๐ฌ" - map[":mailbox_with_no_mail:"] = "๐ญ" - map[":man:"] = "๐จ" - map[":man_with_gua_pi_mao:"] = "๐ฒ" - map[":man_with_turban:"] = "๐ณโโ๏ธ" - map[":mans_shoe:"] = "๐" - map[":maple_leaf:"] = "๐" - map[":mask:"] = "๐ท" - map[":massage:"] = "๐" - map[":meat_on_bone:"] = "๐" - map[":mega:"] = "๐ฃ" - map[":melon:"] = "๐" - map[":memo:"] = "๐" - map[":mens:"] = "๐น" - map[":metal:"] = "๐ค" - map[":metro:"] = "๐" - map[":microphone:"] = "๐ค" - map[":microscope:"] = "๐ฌ" - map[":milky_way:"] = "๐" - map[":minibus:"] = "๐" - map[":minidisc:"] = "๐ฝ" - map[":mobile_phone_off:"] = "๐ด" - map[":money_with_wings:"] = "๐ธ" - map[":moneybag:"] = "๐ฐ" - map[":monkey:"] = "๐" - map[":monkey_face:"] = "๐ต" - map[":monorail:"] = "๐" - map[":mortar_board:"] = "๐" - map[":mount_fuji:"] = "๐ป" - map[":mountain_bicyclist:"] = "๐ต" - map[":mountain_cableway:"] = "๐ " - map[":mountain_railway:"] = "๐" - map[":mouse2:"] = "๐" - map[":mouse:"] = "๐ญ" - map[":movie_camera:"] = "๐ฅ" - map[":moyai:"] = "๐ฟ" - map[":muscle:"] = "๐ช" - map[":mushroom:"] = "๐" - map[":musical_keyboard:"] = "๐น" - map[":musical_note:"] = "๐ต" - map[":musical_score:"] = "๐ผ" - map[":mute:"] = "๐" - map[":nail_care:"] = "๐ " - map[":name_badge:"] = "๐" - map[":necktie:"] = "๐" - map[":negative_squared_cross_mark:"] = "โ" - map[":neutral_face:"] = "๐" - map[":new:"] = "๐" - map[":new_moon:"] = "๐" - map[":new_moon_with_face:"] = "๐" - map[":newspaper:"] = "๐ฐ" - map[":ng:"] = "๐" - map[":nine:"] = "9๏ธโฃ" - map[":no_bell:"] = "๐" - map[":no_bicycles:"] = "๐ณ" - map[":no_entry:"] = "โ" - map[":no_entry_sign:"] = "๐ซ" - map[":no_good:"] = "๐ " - map[":no_mobile_phones:"] = "๐ต" - map[":no_mouth:"] = "๐ถ" - map[":no_pedestrians:"] = "๐ท" - map[":no_smoking:"] = "๐ญ" - map[":nose:"] = "๐" - map[":notebook:"] = "๐" - map[":notebook_with_decorative_cover:"] = "๐" - map[":notes:"] = "๐ถ" - map[":nut_and_bolt:"] = "๐ฉ" - map[":o2:"] = "๐ พ๏ธ" - map[":o:"] = "โญ" - map[":ocean:"] = "๐" - map[":octopus:"] = "๐" - map[":oden:"] = "๐ข" - map[":office:"] = "๐ข" - map[":ok:"] = "๐" - map[":ok_hand:"] = "๐" - map[":ok_woman:"] = "๐โโ๏ธ" - map[":older_man:"] = "๐ด" - map[":older_woman:"] = "๐ต" - map[":on:"] = "๐" - map[":oncoming_automobile:"] = "๐" - map[":oncoming_bus:"] = "๐" - map[":oncoming_police_car:"] = "๐" - map[":oncoming_taxi:"] = "๐" - map[":one:"] = "1๏ธโฃ" - map[":open_file_folder:"] = "๐" - map[":open_hands:"] = "๐" - map[":open_mouth:"] = "๐ฎ" - map[":ophiuchus:"] = "โ" - map[":orange_book:"] = "๐" - map[":outbox_tray:"] = "๐ค" - map[":ox:"] = "๐" - map[":page_facing_up:"] = "๐" - map[":page_with_curl:"] = "๐" - map[":pager:"] = "๐" - map[":palm_tree:"] = "๐ด" - map[":panda_face:"] = "๐ผ" - map[":paperclip:"] = "๐" - map[":parking:"] = "๐ ฟ๏ธ" - map[":part_alternation_mark:"] = "ใฝ๏ธ" - map[":partly_sunny:"] = "โ " - map[":passport_control:"] = "๐" - map[":paw_prints:"] = "๐พ" - map[":peach:"] = "๐" - map[":pear:"] = "๐" - map[":pencil2:"] = "โ๏ธ" - map[":pencil:"] = "๐" - map[":penguin:"] = "๐ง" - map[":pensive:"] = "๐" - map[":performing_arts:"] = "๐ญ" - map[":persevere:"] = "๐ฃ" - map[":pig2:"] = "๐" - map[":pig:"] = "๐ท" - map[":pig_nose:"] = "๐ฝ" - map[":pill:"] = "๐" - map[":pineapple:"] = "๐" - map[":pisces:"] = "โ" - map[":pizza:"] = "๐" - map[":point_down:"] = "๐" - map[":point_left:"] = "๐" - map[":point_right:"] = "๐" - map[":point_up:"] = "โ๏ธ" - map[":point_up_2:"] = "๐" - map[":police_car:"] = "๐" - map[":poodle:"] = "๐ฉ" - map[":poop:"] = "๐ฉ" - map[":post_office:"] = "๐ฃ" - map[":postal_horn:"] = "๐ฏ" - map[":postbox:"] = "๐ฎ" - map[":potable_water:"] = "๐ฐ" - map[":pouch:"] = "๐" - map[":poultry_leg:"] = "๐" - map[":pound:"] = "๐ท" - map[":pouting_cat:"] = "๐พ" - map[":pray:"] = "๐" - map[":princess:"] = "๐ธ" - map[":punch:"] = "๐" - map[":purple_heart:"] = "๐" - map[":purse:"] = "๐" - map[":pushpin:"] = "๐" - map[":put_litter_in_its_place:"] = "๐ฎ" - map[":question:"] = "โ" - map[":rabbit2:"] = "๐" - map[":rabbit:"] = "๐ฐ" - map[":racehorse:"] = "๐" - map[":radio:"] = "๐ป" - map[":radio_button:"] = "๐" - map[":rage:"] = "๐ก" - map[":railway_car:"] = "๐" - map[":rainbow:"] = "๐" - map[":raised_hand:"] = "โ" - map[":raised_hands:"] = "๐" - map[":raising_hand:"] = "๐" - map[":ram:"] = "๐" - map[":ramen:"] = "๐" - map[":rat:"] = "๐" - map[":recycle:"] = "โป๏ธ" - map[":red_car:"] = "๐" - map[":red_circle:"] = "๐ด" - map[":registered:"] = "ยฎ๏ธ" - map[":relaxed:"] = "โบ๏ธ" - map[":relieved:"] = "๐" - map[":repeat:"] = "๐" - map[":repeat_one:"] = "๐" - map[":restroom:"] = "๐ป" - map[":revolving_hearts:"] = "๐" - map[":rewind:"] = "โช" - map[":ribbon:"] = "๐" - map[":rice:"] = "๐" - map[":rice_ball:"] = "๐" - map[":rice_cracker:"] = "๐" - map[":rice_scene:"] = "๐" - map[":ring:"] = "๐" - map[":rocket:"] = "๐" - map[":roller_coaster:"] = "๐ข" - map[":rooster:"] = "๐" - map[":rose:"] = "๐น" - map[":rotating_light:"] = "๐จ" - map[":round_pushpin:"] = "๐" - map[":rowboat:"] = "๐ฃ" - map[":ru:"] = "๐ท๐บ" - map[":rugby_football:"] = "๐" - map[":runner:"] = "๐" - map[":running_shirt_with_sash:"] = "๐ฝ" - map[":sa:"] = "๐๏ธ" - map[":sagittarius:"] = "โ" - map[":sailboat:"] = "โต" - map[":sake:"] = "๐ถ" - map[":sandal:"] = "๐ก" - map[":santa:"] = "๐ " - map[":satellite:"] = "๐ก" - map[":satisfied:"] = "๐" - map[":saxophone:"] = "๐ท" - map[":school:"] = "๐ซ" - map[":school_satchel:"] = "๐" - map[":scissors:"] = "โ๏ธ" - map[":scorpius:"] = "โ" - map[":scream:"] = "๐ฑ" - map[":scream_cat:"] = "๐" - map[":scroll:"] = "๐" - map[":seat:"] = "๐บ" - map[":secret:"] = "ใ๏ธ" - map[":see_no_evil:"] = "๐" - map[":seedling:"] = "๐ฑ" - map[":seven:"] = "7๏ธโฃ" - map[":shaved_ice:"] = "๐ง" - map[":sheep:"] = "๐" - map[":shell:"] = "๐" - map[":ship:"] = "๐ข" - map[":shirt:"] = "๐" - map[":shit:"] = "๐ฉ" - map[":shower:"] = "๐ฟ" - map[":signal_strength:"] = "๐ถ" - map[":six:"] = "6๏ธโฃ" - map[":six_pointed_star:"] = "๐ฏ" - map[":ski:"] = "๐ฟ" - map[":skull:"] = "๐" - map[":sleeping:"] = "๐ด" - map[":sleepy:"] = "๐ช" - map[":slot_machine:"] = "๐ฐ" - map[":small_blue_diamond:"] = "๐น" - map[":small_orange_diamond:"] = "๐ธ" - map[":small_red_triangle:"] = "๐บ" - map[":small_red_triangle_down:"] = "๐ป" - map[":smile:"] = "๐" - map[":smile_cat:"] = "๐ธ" - map[":smiley:"] = "๐" - map[":smiley_cat:"] = "๐บ" - map[":smiling_imp:"] = "๐" - map[":smirk:"] = "๐" - map[":smirk_cat:"] = "๐ผ" - map[":smoking:"] = "๐ฌ" - map[":snail:"] = "๐" - map[":snake:"] = "๐" - map[":snowboarder:"] = "๐" - map[":snowflake:"] = "โ๏ธ" - map[":snowman:"] = "โ" - map[":sob:"] = "๐ญ" - map[":soccer:"] = "โฝ" - map[":soon:"] = "๐" - map[":sos:"] = "๐" - map[":sound:"] = "๐" - map[":space_invader:"] = "๐พ" - map[":spades:"] = "โ ๏ธ" - map[":spaghetti:"] = "๐" - map[":sparkler:"] = "๐" - map[":sparkles:"] = "โจ" - map[":sparkling_heart:"] = "๐" - map[":speak_no_evil:"] = "๐" - map[":speaker:"] = "๐" - map[":speech_balloon:"] = "๐ฌ" - map[":speedboat:"] = "๐ค" - map[":star2:"] = "๐" - map[":star:"] = "โญ" - map[":stars:"] = "๐ " - map[":station:"] = "๐" - map[":statue_of_liberty:"] = "๐ฝ" - map[":steam_locomotive:"] = "๐" - map[":stew:"] = "๐ฒ" - map[":straight_ruler:"] = "๐" - map[":strawberry:"] = "๐" - map[":stuck_out_tongue:"] = "๐" - map[":stuck_out_tongue_closed_eyes:"] = "๐" - map[":stuck_out_tongue_winking_eye:"] = "๐" - map[":sun_with_face:"] = "๐" - map[":sunflower:"] = "๐ป" - map[":sunglasses:"] = "๐" - map[":sunny:"] = "โ๏ธ" - map[":sunrise:"] = "๐ " - map[":sunrise_over_mountains:"] = "๐" - map[":surfer:"] = "๐" - map[":sushi:"] = "๐ฃ" - map[":suspension_railway:"] = "๐" - map[":sweat:"] = "๐" - map[":sweat_drops:"] = "๐ฆ" - map[":sweat_smile:"] = "๐ " - map[":sweet_potato:"] = "๐ " - map[":swimmer:"] = "๐" - map[":symbols:"] = "๐ฃ" - map[":syringe:"] = "๐" - map[":tada:"] = "๐" - map[":tanabata_tree:"] = "๐" - map[":tangerine:"] = "๐" - map[":taurus:"] = "โ" - map[":taxi:"] = "๐" - map[":tea:"] = "๐ต" - map[":telephone:"] = "โ๏ธ" - map[":telephone_receiver:"] = "๐" - map[":telescope:"] = "๐ญ" - map[":tennis:"] = "๐พ" - map[":tent:"] = "โบ" - map[":thought_balloon:"] = "๐ญ" - map[":three:"] = "3๏ธโฃ" - map[":thumbsdown:"] = "๐" - map[":thumbsup:"] = "๐" - map[":ticket:"] = "๐ซ" - map[":tiger2:"] = "๐ " - map[":tiger:"] = "๐ฏ" - map[":tired_face:"] = "๐ซ" - map[":tm:"] = "โข๏ธ" - map[":toilet:"] = "๐ฝ" - map[":tokyo_tower:"] = "๐ผ" - map[":tomato:"] = "๐ " - map[":tongue:"] = "๐ " - map[":top:"] = "๐" - map[":tophat:"] = "๐ฉ" - map[":tractor:"] = "๐" - map[":traffic_light:"] = "๐ฅ" - map[":train2:"] = "๐" - map[":train:"] = "๐" - map[":tram:"] = "๐" - map[":triangular_flag_on_post:"] = "๐ฉ" - map[":triangular_ruler:"] = "๐" - map[":trident:"] = "๐ฑ" - map[":triumph:"] = "๐ค" - map[":trolleybus:"] = "๐" - map[":trophy:"] = "๐" - map[":tropical_drink:"] = "๐น" - map[":tropical_fish:"] = "๐ " - map[":truck:"] = "๐" - map[":trumpet:"] = "๐บ" - map[":tulip:"] = "๐ท" - map[":turtle:"] = "๐ข" - map[":tv:"] = "๐บ" - map[":twisted_rightwards_arrows:"] = "๐" - map[":two:"] = "2๏ธโฃ" - map[":two_men_holding_hands:"] = "๐ฌ" - map[":two_women_holding_hands:"] = "๐ญ" - map[":u5272:"] = "๐น" - map[":u5408:"] = "๐ด" - map[":u55b6:"] = "๐บ" - map[":u6307:"] = "๐ฏ" - map[":u6708:"] = "๐ท๏ธ" - map[":u6709:"] = "๐ถ" - map[":u6e80:"] = "๐ต" - map[":u7121:"] = "๐" - map[":u7533:"] = "๐ธ" - map[":u7981:"] = "๐ฒ" - map[":u7a7a:"] = "๐ณ" - map[":umbrella:"] = "โ" - map[":unamused:"] = "๐" - map[":underage:"] = "๐" - map[":unlock:"] = "๐" - map[":up:"] = "๐" - map[":us:"] = "๐บ๐ธ" - map[":v:"] = "โ๏ธ" - map[":vertical_traffic_light:"] = "๐ฆ" - map[":vhs:"] = "๐ผ" - map[":vibration_mode:"] = "๐ณ" - map[":video_camera:"] = "๐น" - map[":video_game:"] = "๐ฎ" - map[":violin:"] = "๐ป" - map[":virgo:"] = "โ" - map[":volcano:"] = "๐" - map[":vs:"] = "๐" - map[":walking:"] = "๐ถ" - map[":waning_crescent_moon:"] = "๐" - map[":waning_gibbous_moon:"] = "๐" - map[":warning:"] = "โ ๏ธ" - map[":watch:"] = "โ" - map[":water_buffalo:"] = "๐" - map[":watermelon:"] = "๐" - map[":wave:"] = "๐" - map[":wavy_dash:"] = "ใฐ๏ธ" - map[":waxing_crescent_moon:"] = "๐" - map[":waxing_gibbous_moon:"] = "๐" - map[":wc:"] = "๐พ" - map[":weary:"] = "๐ฉ" - map[":wedding:"] = "๐" - map[":whale2:"] = "๐" - map[":whale:"] = "๐ณ" - map[":wheelchair:"] = "โฟ" - map[":white_check_mark:"] = "โ " - map[":white_circle:"] = "โช" - map[":white_flower:"] = "๐ฎ" - map[":white_square_button:"] = "๐ณ" - map[":wind_chime:"] = "๐" - map[":wine_glass:"] = "๐ท" - map[":wink:"] = "๐" - map[":wolf:"] = "๐บ" - map[":woman:"] = "๐ฉ" - map[":womans_clothes:"] = "๐" - map[":womans_hat:"] = "๐" - map[":womens:"] = "๐บ" - map[":worried:"] = "๐" - map[":wrench:"] = "๐ง" - map[":x:"] = "โ" - map[":yellow_heart:"] = "๐" - map[":yen:"] = "๐ด" - map[":yum:"] = "๐" - map[":zap:"] = "โก" - map[":zero:"] = "0๏ธโฃ" - map[":zzz:"] = "๐ค" + if (emoji_file == "") { + emoji_file = "emoji.tsv" + } + + while ((getline line < emoji_file) > 0) { + split(line, parts, "\t") + if (length(parts[1]) > 0) { + map[parts[1]] = parts[2] + } + } + close(emoji_file) } { if ($0 ~ /
/) in_pre = 1
@@ -833,6 +17,7 @@ BEGIN {
code_count = 0
line = $0
out = ""
+
while (match(line, /[^<]*<\/code>/)) {
code_count++
code_store[code_count] = substr(line, RSTART, RLENGTH)
@@ -841,14 +26,23 @@ BEGIN {
}
out = out line
- for (sc in map) {
- if (index(out, sc)) {
- gsub(sc, map[sc], out)
+ line = out
+ out = ""
+ while (match(line, /:[A-Za-z0-9_+\-]+:/)) {
+ token = substr(line, RSTART, RLENGTH)
+ out = out substr(line, 1, RSTART - 1)
+ if (token in map) {
+ out = out map[token]
+ } else {
+ out = out token
}
+ line = substr(line, RSTART + RLENGTH)
}
+ out = out line
for (i = 1; i <= code_count; i++) {
gsub("\034EC" i "\034", code_store[i], out)
+ delete code_store[i]
}
$0 = out
}
diff --git a/awk/emoji.tsv b/awk/emoji.tsv
new file mode 100644
index 0000000..8f7459c
--- /dev/null
+++ b/awk/emoji.tsv
@@ -0,0 +1,827 @@
+:+1: ๐
+:100: ๐ฏ
+:1234: ๐ข
+:8ball: ๐ฑ
+:a: ๐
ฐ๏ธ
+:ab: ๐
+:abc: ๐ค
+:abcd: ๐ก
+:accept: ๐
+:aerial_tramway: ๐ก
+:airplane: โ๏ธ
+:alarm_clock: โฐ
+:alien: ๐ฝ
+:ambulance: ๐
+:anchor: โ
+:angel: ๐ผ
+:anger: ๐ข
+:angry: ๐
+:anguished: ๐ง
+:ant: ๐
+:apple: ๐
+:aquarius: โ
+:aries: โ
+:arrow_backward: โ๏ธ
+:arrow_double_down: โฌ
+:arrow_double_up: โซ
+:arrow_down: โฌ๏ธ
+:arrow_down_small: ๐ฝ
+:arrow_forward: โถ๏ธ
+:arrow_heading_down: โคต๏ธ
+:arrow_heading_up: โคด๏ธ
+:arrow_left: โฌ
๏ธ
+:arrow_lower_left: โ๏ธ
+:arrow_lower_right: โ๏ธ
+:arrow_right: โก๏ธ
+:arrow_right_hook: โช๏ธ
+:arrow_up: โฌ๏ธ
+:arrow_up_down: โ๏ธ
+:arrow_up_small: ๐ผ
+:arrow_upper_left: โ๏ธ
+:arrow_upper_right: โ๏ธ
+:arrows_clockwise: ๐
+:arrows_counterclockwise: ๐
+:art: ๐จ
+:articulated_lorry: ๐
+:astonished: ๐ฒ
+:atm: ๐ง
+:b: ๐
ฑ๏ธ
+:baby: ๐ถ
+:baby_bottle: ๐ผ
+:baby_chick: ๐ค
+:baby_symbol: ๐ผ
+:baggage_claim: ๐
+:balloon: ๐
+:ballot_box_with_check: โ๏ธ
+:bamboo: ๐
+:banana: ๐
+:bangbang: โผ๏ธ
+:bank: ๐ฆ
+:bar_chart: ๐
+:barber: ๐
+:baseball: โพ
+:basketball: ๐
+:bath: ๐
+:bathtub: ๐
+:battery: ๐
+:bear: ๐ป
+:beer: ๐บ
+:beers: ๐ป
+:beetle: ๐ชฒ
+:beginner: ๐ฐ
+:bell: ๐
+:bento: ๐ฑ
+:bicyclist: ๐ด
+:bike: ๐ฒ
+:bikini: ๐
+:bird: ๐ฆ
+:birthday: ๐
+:black_circle: โซ
+:black_joker: ๐
+:black_nib: โ๏ธ
+:black_square_button: ๐ฒ
+:blossom: ๐ผ
+:blowfish: ๐ก
+:blue_book: ๐
+:blue_car: ๐
+:blue_heart: ๐
+:blush: ๐
+:boar: ๐
+:boat: โต
+:bomb: ๐ฃ
+:book: ๐
+:bookmark: ๐
+:bookmark_tabs: ๐
+:books: ๐
+:boom: ๐ฅ
+:boot: ๐ข
+:bouquet: ๐
+:bow: ๐
+:bowling: ๐ณ
+:boy: ๐ฆ
+:bread: ๐
+:bride_with_veil: ๐ฐโโ๏ธ
+:bridge_at_night: ๐
+:briefcase: ๐ผ
+:broken_heart: ๐
+:bug: ๐
+:bulb: ๐ก
+:bullettrain_front: ๐
+:bullettrain_side: ๐
+:bus: ๐
+:busstop: ๐
+:bust_in_silhouette: ๐ค
+:busts_in_silhouette: ๐ฅ
+:cactus: ๐ต
+:cake: ๐ฐ
+:calendar: ๐
+:calling: ๐ฒ
+:camel: ๐ซ
+:camera: ๐ท
+:cancer: โ
+:candy: ๐ฌ
+:capital_abcd: ๐
+:capricorn: โ
+:car: ๐
+:card_index: ๐
+:carousel_horse: ๐
+:cat2: ๐
+:cat: ๐ฑ
+:cd: ๐ฟ
+:chart: ๐น
+:chart_with_downwards_trend: ๐
+:chart_with_upwards_trend: ๐
+:checkered_flag: ๐
+:cherries: ๐
+:cherry_blossom: ๐ธ
+:chestnut: ๐ฐ
+:chicken: ๐
+:children_crossing: ๐ธ
+:chocolate_bar: ๐ซ
+:christmas_tree: ๐
+:church: โช
+:cinema: ๐ฆ
+:circus_tent: ๐ช
+:city_sunrise: ๐
+:city_sunset: ๐
+:cl: ๐
+:clap: ๐
+:clapper: ๐ฌ
+:clipboard: ๐
+:clock1030: ๐ฅ
+:clock10: ๐
+:clock1130: ๐ฆ
+:clock11: ๐
+:clock1230: ๐ง
+:clock12: ๐
+:clock130: ๐
+:clock1: ๐
+:clock230: ๐
+:clock2: ๐
+:clock330: ๐
+:clock3: ๐
+:clock430: ๐
+:clock4: ๐
+:clock530: ๐
+:clock5: ๐
+:clock630: ๐ก
+:clock6: ๐
+:clock730: ๐ข
+:clock7: ๐
+:clock830: ๐ฃ
+:clock8: ๐
+:clock930: ๐ค
+:clock9: ๐
+:closed_book: ๐
+:closed_lock_with_key: ๐
+:closed_umbrella: ๐
+:cloud: โ๏ธ
+:clubs: โฃ๏ธ
+:cn: ๐จ๐ณ
+:cocktail: ๐ธ
+:coffee: โ
+:cold_sweat: ๐ฐ
+:computer: ๐ป
+:confetti_ball: ๐
+:confounded: ๐
+:confused: ๐
+:congratulations: ใ๏ธ
+:construction: ๐ง
+:construction_worker: ๐ท
+:convenience_store: ๐ช
+:cookie: ๐ช
+:cool: ๐
+:cop: ๐ฎ
+:copyright: ยฉ๏ธ
+:corn: ๐ฝ
+:couple: ๐ซ
+:couple_with_heart: ๐
+:couplekiss: ๐
+:cow2: ๐
+:cow: ๐ฎ
+:credit_card: ๐ณ
+:crocodile: ๐
+:crossed_flags: ๐
+:crown: ๐
+:cry: ๐ข
+:crying_cat_face: ๐ฟ
+:crystal_ball: ๐ฎ
+:cupid: ๐
+:curly_loop: โฐ
+:currency_exchange: ๐ฑ
+:curry: ๐
+:custard: ๐ฎ
+:customs: ๐
+:cyclone: ๐
+:dancer: ๐
+:dancers: ๐ฏ
+:dango: ๐ก
+:dart: ๐ฏ
+:dash: ๐จ
+:date: ๐
+:de: ๐ฉ๐ช
+:deciduous_tree: ๐ณ
+:department_store: ๐ฌ
+:diamond_shape_with_a_dot_inside: ๐
+:diamonds: โฆ๏ธ
+:disappointed: ๐
+:disappointed_relieved: ๐ฅ
+:dizzy: ๐ซ
+:dizzy_face: ๐ต
+:do_not_litter: ๐ฏ
+:dog2: ๐
+:dog: ๐ถ
+:dollar: ๐ต
+:dolls: ๐
+:dolphin: ๐ฌ
+:door: ๐ช
+:doughnut: ๐ฉ
+:dragon: ๐
+:dragon_face: ๐ฒ
+:dress: ๐
+:dromedary_camel: ๐ช
+:droplet: ๐ง
+:dvd: ๐
+:ear: ๐
+:ear_of_rice: ๐พ
+:earth_africa: ๐
+:earth_americas: ๐
+:earth_asia: ๐
+:egg: ๐ฅ
+:eggplant: ๐
+:eight: 8๏ธโฃ
+:eight_pointed_black_star: โด๏ธ
+:eight_spoked_asterisk: โณ๏ธ
+:electric_plug: ๐
+:elephant: ๐
+:email: ๐ง
+:end: ๐
+:envelope: โ๏ธ
+:es: ๐ช๐ธ
+:euro: ๐ถ
+:european_castle: ๐ฐ
+:european_post_office: ๐ค
+:evergreen_tree: ๐ฒ
+:exclamation: โ
+:expressionless: ๐
+:eyeglasses: ๐
+:eyes: ๐
+:factory: ๐ญ
+:fallen_leaf: ๐
+:family: ๐ช
+:fast_forward: โฉ
+:fax: ๐
+:fearful: ๐จ
+:feet: ๐พ
+:ferris_wheel: ๐ก
+:file_folder: ๐
+:fire: ๐ฅ
+:fire_engine: ๐
+:fireworks: ๐
+:first_quarter_moon: ๐
+:first_quarter_moon_with_face: ๐
+:fish: ๐
+:fish_cake: ๐ฅ
+:fishing_pole_and_fish: ๐ฃ
+:fist: โ
+:five: 5๏ธโฃ
+:flags: ๐
+:flashlight: ๐ฆ
+:floppy_disk: ๐พ
+:flower_playing_cards: ๐ด
+:flushed: ๐ณ
+:foggy: ๐
+:football: ๐
+:fork_and_knife: ๐ด
+:fountain: โฒ
+:four: 4๏ธโฃ
+:four_leaf_clover: ๐
+:fr: ๐ซ๐ท
+:free: ๐
+:fried_shrimp: ๐ค
+:fries: ๐
+:frog: ๐ธ
+:frowning: ๐ฆ
+:fuelpump: โฝ
+:full_moon: ๐
+:full_moon_with_face: ๐
+:game_die: ๐ฒ
+:gem: ๐
+:gemini: โ
+:ghost: ๐ป
+:gift: ๐
+:gift_heart: ๐
+:girl: ๐ง
+:globe_with_meridians: ๐
+:goat: ๐
+:golf: โณ
+:grapes: ๐
+:green_apple: ๐
+:green_book: ๐
+:green_heart: ๐
+:grey_exclamation: โ
+:grey_question: โ
+:grimacing: ๐ฌ
+:grin: ๐
+:grinning: ๐
+:guardsman: ๐โโ๏ธ
+:guitar: ๐ธ
+:gun: ๐ซ
+:haircut: ๐
+:hamburger: ๐
+:hammer: ๐จ
+:hamster: ๐น
+:handbag: ๐
+:hankey: ๐ฉ
+:hash: #๏ธโฃ
+:hatched_chick: ๐ฅ
+:hatching_chick: ๐ฃ
+:headphones: ๐ง
+:hear_no_evil: ๐
+:heart: โค๏ธ
+:heart_decoration: ๐
+:heart_eyes: ๐
+:heart_eyes_cat: ๐ป
+:heartbeat: ๐
+:hearts: โฅ๏ธ
+:heavy_check_mark: โ๏ธ
+:heavy_division_sign: โ
+:heavy_dollar_sign: ๐ฒ
+:heavy_minus_sign: โ
+:heavy_multiplication_x: โ๏ธ
+:heavy_plus_sign: โ
+:helicopter: ๐
+:herb: ๐ฟ
+:hibiscus: ๐บ
+:high_brightness: ๐
+:high_heel: ๐
+:honey_pot: ๐ฏ
+:horse: ๐ด
+:horse_racing: ๐
+:hospital: ๐ฅ
+:hotel: ๐จ
+:hotsprings: โจ๏ธ
+:hourglass: โ
+:hourglass_flowing_sand: โณ
+:house: ๐
+:house_with_garden: ๐ก
+:hushed: ๐ฏ
+:ice_cream: ๐จ
+:icecream: ๐ฆ
+:id: ๐
+:ideograph_advantage: ๐
+:imp: ๐ฟ
+:inbox_tray: ๐ฅ
+:incoming_envelope: ๐จ
+:information_desk_person: ๐
+:information_source: โน๏ธ
+:innocent: ๐
+:interrobang: โ๏ธ
+:iphone: ๐ฑ
+:it: ๐ฎ๐น
+:izakaya_lantern: ๐ฎ
+:jack_o_lantern: ๐
+:japan: ๐พ
+:japanese_castle: ๐ฏ
+:japanese_goblin: ๐บ
+:japanese_ogre: ๐น
+:jeans: ๐
+:joy: ๐
+:joy_cat: ๐น
+:jp: ๐ฏ๐ต
+:key: ๐
+:keycap_ten: ๐
+:kimono: ๐
+:kiss: ๐
+:kissing: ๐
+:kissing_cat: ๐ฝ
+:kissing_closed_eyes: ๐
+:kissing_heart: ๐
+:kissing_smiling_eyes: ๐
+:koala: ๐จ
+:koko: ๐
+:kr: ๐ฐ๐ท
+:large_blue_diamond: ๐ท
+:large_orange_diamond: ๐ถ
+:last_quarter_moon: ๐
+:last_quarter_moon_with_face: ๐
+:laughing: ๐
+:leaves: ๐
+:ledger: ๐
+:left_luggage: ๐
+:left_right_arrow: โ๏ธ
+:leftwards_arrow_with_hook: โฉ๏ธ
+:lemon: ๐
+:leo: โ
+:leopard: ๐
+:libra: โ
+:light_rail: ๐
+:link: ๐
+:lips: ๐
+:lipstick: ๐
+:lock: ๐
+:lock_with_ink_pen: ๐
+:lollipop: ๐ญ
+:loop: โฟ
+:loudspeaker: ๐ข
+:love_hotel: ๐ฉ
+:love_letter: ๐
+:low_brightness: ๐
+:m: โ๏ธ
+:mag: ๐
+:mag_right: ๐
+:mahjong: ๐
+:mailbox: ๐ซ
+:mailbox_closed: ๐ช
+:mailbox_with_mail: ๐ฌ
+:mailbox_with_no_mail: ๐ญ
+:man: ๐จ
+:man_with_gua_pi_mao: ๐ฒ
+:man_with_turban: ๐ณโโ๏ธ
+:mans_shoe: ๐
+:maple_leaf: ๐
+:mask: ๐ท
+:massage: ๐
+:meat_on_bone: ๐
+:mega: ๐ฃ
+:melon: ๐
+:memo: ๐
+:mens: ๐น
+:metal: ๐ค
+:metro: ๐
+:microphone: ๐ค
+:microscope: ๐ฌ
+:milky_way: ๐
+:minibus: ๐
+:minidisc: ๐ฝ
+:mobile_phone_off: ๐ด
+:money_with_wings: ๐ธ
+:moneybag: ๐ฐ
+:monkey: ๐
+:monkey_face: ๐ต
+:monorail: ๐
+:mortar_board: ๐
+:mount_fuji: ๐ป
+:mountain_bicyclist: ๐ต
+:mountain_cableway: ๐
+:mountain_railway: ๐
+:mouse2: ๐
+:mouse: ๐ญ
+:movie_camera: ๐ฅ
+:moyai: ๐ฟ
+:muscle: ๐ช
+:mushroom: ๐
+:musical_keyboard: ๐น
+:musical_note: ๐ต
+:musical_score: ๐ผ
+:mute: ๐
+:nail_care: ๐
+:name_badge: ๐
+:necktie: ๐
+:negative_squared_cross_mark: โ
+:neutral_face: ๐
+:new: ๐
+:new_moon: ๐
+:new_moon_with_face: ๐
+:newspaper: ๐ฐ
+:ng: ๐
+:nine: 9๏ธโฃ
+:no_bell: ๐
+:no_bicycles: ๐ณ
+:no_entry: โ
+:no_entry_sign: ๐ซ
+:no_good: ๐
+:no_mobile_phones: ๐ต
+:no_mouth: ๐ถ
+:no_pedestrians: ๐ท
+:no_smoking: ๐ญ
+:nose: ๐
+:notebook: ๐
+:notebook_with_decorative_cover: ๐
+:notes: ๐ถ
+:nut_and_bolt: ๐ฉ
+:o2: ๐
พ๏ธ
+:o: โญ
+:ocean: ๐
+:octopus: ๐
+:oden: ๐ข
+:office: ๐ข
+:ok: ๐
+:ok_hand: ๐
+:ok_woman: ๐โโ๏ธ
+:older_man: ๐ด
+:older_woman: ๐ต
+:on: ๐
+:oncoming_automobile: ๐
+:oncoming_bus: ๐
+:oncoming_police_car: ๐
+:oncoming_taxi: ๐
+:one: 1๏ธโฃ
+:open_file_folder: ๐
+:open_hands: ๐
+:open_mouth: ๐ฎ
+:ophiuchus: โ
+:orange_book: ๐
+:outbox_tray: ๐ค
+:ox: ๐
+:page_facing_up: ๐
+:page_with_curl: ๐
+:pager: ๐
+:palm_tree: ๐ด
+:panda_face: ๐ผ
+:paperclip: ๐
+:parking: ๐
ฟ๏ธ
+:part_alternation_mark: ใฝ๏ธ
+:partly_sunny: โ
+:passport_control: ๐
+:paw_prints: ๐พ
+:peach: ๐
+:pear: ๐
+:pencil2: โ๏ธ
+:pencil: ๐
+:penguin: ๐ง
+:pensive: ๐
+:performing_arts: ๐ญ
+:persevere: ๐ฃ
+:pig2: ๐
+:pig: ๐ท
+:pig_nose: ๐ฝ
+:pill: ๐
+:pineapple: ๐
+:pisces: โ
+:pizza: ๐
+:point_down: ๐
+:point_left: ๐
+:point_right: ๐
+:point_up: โ๏ธ
+:point_up_2: ๐
+:police_car: ๐
+:poodle: ๐ฉ
+:poop: ๐ฉ
+:post_office: ๐ฃ
+:postal_horn: ๐ฏ
+:postbox: ๐ฎ
+:potable_water: ๐ฐ
+:pouch: ๐
+:poultry_leg: ๐
+:pound: ๐ท
+:pouting_cat: ๐พ
+:pray: ๐
+:princess: ๐ธ
+:punch: ๐
+:purple_heart: ๐
+:purse: ๐
+:pushpin: ๐
+:put_litter_in_its_place: ๐ฎ
+:question: โ
+:rabbit2: ๐
+:rabbit: ๐ฐ
+:racehorse: ๐
+:radio: ๐ป
+:radio_button: ๐
+:rage: ๐ก
+:railway_car: ๐
+:rainbow: ๐
+:raised_hand: โ
+:raised_hands: ๐
+:raising_hand: ๐
+:ram: ๐
+:ramen: ๐
+:rat: ๐
+:recycle: โป๏ธ
+:red_car: ๐
+:red_circle: ๐ด
+:registered: ยฎ๏ธ
+:relaxed: โบ๏ธ
+:relieved: ๐
+:repeat: ๐
+:repeat_one: ๐
+:restroom: ๐ป
+:revolving_hearts: ๐
+:rewind: โช
+:ribbon: ๐
+:rice: ๐
+:rice_ball: ๐
+:rice_cracker: ๐
+:rice_scene: ๐
+:ring: ๐
+:rocket: ๐
+:roller_coaster: ๐ข
+:rooster: ๐
+:rose: ๐น
+:rotating_light: ๐จ
+:round_pushpin: ๐
+:rowboat: ๐ฃ
+:ru: ๐ท๐บ
+:rugby_football: ๐
+:runner: ๐
+:running_shirt_with_sash: ๐ฝ
+:sa: ๐๏ธ
+:sagittarius: โ
+:sailboat: โต
+:sake: ๐ถ
+:sandal: ๐ก
+:santa: ๐
+:satellite: ๐ก
+:satisfied: ๐
+:saxophone: ๐ท
+:school: ๐ซ
+:school_satchel: ๐
+:scissors: โ๏ธ
+:scorpius: โ
+:scream: ๐ฑ
+:scream_cat: ๐
+:scroll: ๐
+:seat: ๐บ
+:secret: ใ๏ธ
+:see_no_evil: ๐
+:seedling: ๐ฑ
+:seven: 7๏ธโฃ
+:shaved_ice: ๐ง
+:sheep: ๐
+:shell: ๐
+:ship: ๐ข
+:shirt: ๐
+:shit: ๐ฉ
+:shower: ๐ฟ
+:signal_strength: ๐ถ
+:six: 6๏ธโฃ
+:six_pointed_star: ๐ฏ
+:ski: ๐ฟ
+:skull: ๐
+:sleeping: ๐ด
+:sleepy: ๐ช
+:slot_machine: ๐ฐ
+:small_blue_diamond: ๐น
+:small_orange_diamond: ๐ธ
+:small_red_triangle: ๐บ
+:small_red_triangle_down: ๐ป
+:smile: ๐
+:smile_cat: ๐ธ
+:smiley: ๐
+:smiley_cat: ๐บ
+:smiling_imp: ๐
+:smirk: ๐
+:smirk_cat: ๐ผ
+:smoking: ๐ฌ
+:snail: ๐
+:snake: ๐
+:snowboarder: ๐
+:snowflake: โ๏ธ
+:snowman: โ
+:sob: ๐ญ
+:soccer: โฝ
+:soon: ๐
+:sos: ๐
+:sound: ๐
+:space_invader: ๐พ
+:spades: โ ๏ธ
+:spaghetti: ๐
+:sparkler: ๐
+:sparkles: โจ
+:sparkling_heart: ๐
+:speak_no_evil: ๐
+:speaker: ๐
+:speech_balloon: ๐ฌ
+:speedboat: ๐ค
+:star2: ๐
+:star: โญ
+:stars: ๐
+:station: ๐
+:statue_of_liberty: ๐ฝ
+:steam_locomotive: ๐
+:stew: ๐ฒ
+:straight_ruler: ๐
+:strawberry: ๐
+:stuck_out_tongue: ๐
+:stuck_out_tongue_closed_eyes: ๐
+:stuck_out_tongue_winking_eye: ๐
+:sun_with_face: ๐
+:sunflower: ๐ป
+:sunglasses: ๐
+:sunny: โ๏ธ
+:sunrise: ๐
+:sunrise_over_mountains: ๐
+:surfer: ๐
+:sushi: ๐ฃ
+:suspension_railway: ๐
+:sweat: ๐
+:sweat_drops: ๐ฆ
+:sweat_smile: ๐
+:sweet_potato: ๐
+:swimmer: ๐
+:symbols: ๐ฃ
+:syringe: ๐
+:tada: ๐
+:tanabata_tree: ๐
+:tangerine: ๐
+:taurus: โ
+:taxi: ๐
+:tea: ๐ต
+:telephone: โ๏ธ
+:telephone_receiver: ๐
+:telescope: ๐ญ
+:tennis: ๐พ
+:tent: โบ
+:thought_balloon: ๐ญ
+:three: 3๏ธโฃ
+:thumbsdown: ๐
+:thumbsup: ๐
+:ticket: ๐ซ
+:tiger2: ๐
+:tiger: ๐ฏ
+:tired_face: ๐ซ
+:tm: โข๏ธ
+:toilet: ๐ฝ
+:tokyo_tower: ๐ผ
+:tomato: ๐
+:tongue: ๐
+:top: ๐
+:tophat: ๐ฉ
+:tractor: ๐
+:traffic_light: ๐ฅ
+:train2: ๐
+:train: ๐
+:tram: ๐
+:triangular_flag_on_post: ๐ฉ
+:triangular_ruler: ๐
+:trident: ๐ฑ
+:triumph: ๐ค
+:trolleybus: ๐
+:trophy: ๐
+:tropical_drink: ๐น
+:tropical_fish: ๐
+:truck: ๐
+:trumpet: ๐บ
+:tulip: ๐ท
+:turtle: ๐ข
+:tv: ๐บ
+:twisted_rightwards_arrows: ๐
+:two: 2๏ธโฃ
+:two_men_holding_hands: ๐ฌ
+:two_women_holding_hands: ๐ญ
+:u5272: ๐น
+:u5408: ๐ด
+:u55b6: ๐บ
+:u6307: ๐ฏ
+:u6708: ๐ท๏ธ
+:u6709: ๐ถ
+:u6e80: ๐ต
+:u7121: ๐
+:u7533: ๐ธ
+:u7981: ๐ฒ
+:u7a7a: ๐ณ
+:umbrella: โ
+:unamused: ๐
+:underage: ๐
+:unlock: ๐
+:up: ๐
+:us: ๐บ๐ธ
+:v: โ๏ธ
+:vertical_traffic_light: ๐ฆ
+:vhs: ๐ผ
+:vibration_mode: ๐ณ
+:video_camera: ๐น
+:video_game: ๐ฎ
+:violin: ๐ป
+:virgo: โ
+:volcano: ๐
+:vs: ๐
+:walking: ๐ถ
+:waning_crescent_moon: ๐
+:waning_gibbous_moon: ๐
+:warning: โ ๏ธ
+:watch: โ
+:water_buffalo: ๐
+:watermelon: ๐
+:wave: ๐
+:wavy_dash: ใฐ๏ธ
+:waxing_crescent_moon: ๐
+:waxing_gibbous_moon: ๐
+:wc: ๐พ
+:weary: ๐ฉ
+:wedding: ๐
+:whale2: ๐
+:whale: ๐ณ
+:wheelchair: โฟ
+:white_check_mark: โ
+:white_circle: โช
+:white_flower: ๐ฎ
+:white_square_button: ๐ณ
+:wind_chime: ๐
+:wine_glass: ๐ท
+:wink: ๐
+:wolf: ๐บ
+:woman: ๐ฉ
+:womans_clothes: ๐
+:womans_hat: ๐
+:womens: ๐บ
+:worried: ๐
+:wrench: ๐ง
+:x: โ
+:yellow_heart: ๐
+:yen: ๐ด
+:yum: ๐
+:zap: โก
+:zero: 0๏ธโฃ
+:zzz: ๐ค
diff --git a/awk/generate_sidebar.awk b/awk/generate_sidebar.awk
index 8088264..bac0a3a 100644
--- a/awk/generate_sidebar.awk
+++ b/awk/generate_sidebar.awk
@@ -3,6 +3,15 @@ function title_from_name(name) {
gsub(/-/, " ", name)
return name
}
+function url_encode_path(path) {
+ gsub(/%/, "%25", path)
+ gsub(/ /, "%20", path)
+ gsub(/#/, "%23", path)
+ gsub(/\?/, "%3F", path)
+ gsub(/"/, "%22", path)
+ gsub(/'/, "%27", path)
+ return path
+}
function get_title(path, default_title, full_path, line, title, in_fm) {
full_path = src "/" path
@@ -172,7 +181,7 @@ END {
continue
}
- printf "%s\n", dir_path, get_title(this_d, title_from_name(parts[i]))
+ printf "- %s
\n", url_encode_path(dir_path), get_title(this_d, title_from_name(parts[i]))
opened_levels[++depth] = i
}
@@ -183,7 +192,7 @@ END {
is_single = (single_file_index == "true" && md_count[curr_dir] == 1 && !has_index[curr_dir])
if (parts[n] != "index.md" && !is_single) {
- path = "/" rel
+ path = url_encode_path("/" rel)
gsub(/\.md$/, ".html", path)
printf "- %s
\n", path, get_title(rel, title_from_name(parts[n]))
}
diff --git a/awk/headers.awk b/awk/headers.awk
index 748e91a..fb9392d 100644
--- a/awk/headers.awk
+++ b/awk/headers.awk
@@ -13,6 +13,24 @@ function strip_markdown(s) {
gsub(/-+$/, "", s)
return s
}
+function unique_id(raw_id, candidate) {
+ candidate = raw_id
+ if (candidate == "") candidate = "section"
+ if (!(candidate in seen_ids)) {
+ seen_ids[candidate] = 1
+ return candidate
+ }
+ seen_ids[candidate]++
+ return candidate "-" seen_ids[candidate]
+}
+function print_heading(tag, line, id) {
+ id = unique_id(strip_markdown(line))
+ if (enable_header_links == "true") {
+ print "<" tag " id=\"" id "\">" line " #" tag ">"
+ } else {
+ print "<" tag " id=\"" id "\">" line "" tag ">"
+ }
+}
function print_header(line) {
tag = ""
if (line ~ /^# /) { tag = "h1"; sub(/^# /, "", line) }
@@ -23,12 +41,7 @@ function print_header(line) {
else if (line ~ /^###### /) { tag = "h6"; sub(/^###### /, "", line) }
if (tag != "") {
- id = strip_markdown(line)
- if (enable_header_links == "true") {
- print "<" tag " id=\"" id "\">" line "" tag ">"
- } else {
- print "<" tag " id=\"" id "\">" line "" tag ">"
- }
+ print_heading(tag, line)
} else {
print line
}
@@ -52,7 +65,7 @@ BEGIN {
if ($0 ~ /^=+$/) {
if (has_prev && prev != "" && prev !~ /^<[a-z]/) {
- print "" prev "
"
+ print_heading("h1", prev)
has_prev = 0
} else {
if (has_prev) print_header(prev)
@@ -61,7 +74,7 @@ BEGIN {
}
} else if ($0 ~ /^-+$/) {
if (has_prev && prev != "" && prev !~ /^<[a-z]/) {
- print "" prev "
"
+ print_heading("h2", prev)
has_prev = 0
} else {
if (has_prev) print_header(prev)
diff --git a/awk/render_template.awk b/awk/render_template.awk
index 1b23451..7e72fcd 100644
--- a/awk/render_template.awk
+++ b/awk/render_template.awk
@@ -16,6 +16,7 @@ BEGIN {
style_path = ENVIRON["AWK_STYLE_PATH"]
head_extra = ENVIRON["AWK_HEAD_EXTRA"]
header_brand = ENVIRON["AWK_HEADER_BRAND"]
+ header_search = ENVIRON["AWK_HEADER_SEARCH"]
lang = ENVIRON["AWK_LANG"]
version = ENVIRON["AWK_VERSION"]
content_warning = ENVIRON["AWK_CONTENT_WARNING"]
@@ -33,6 +34,7 @@ BEGIN {
line = replace_all(line, "{{CSS}}", style_path)
line = replace_all(line, "{{HEAD_EXTRA}}", head_extra)
line = replace_all(line, "{{HEADER_BRAND}}", header_brand)
+ line = replace_all(line, "{{HEADER_SEARCH}}", header_search)
line = replace_all(line, "{{VERSION}}", version)
pos = index(line, "{{CONTENT}}")
diff --git a/lib/builder.sh b/lib/builder.sh
index d98f2b3..755c568 100644
--- a/lib/builder.sh
+++ b/lib/builder.sh
@@ -68,14 +68,16 @@ eval "find \"$src\" \( $IGNORE_ARGS \) -prune -o -type d -print" | sort | while
if [ "$md_count" -eq 1 ]; then
md_file=$(find "$dir" ! -name "$(basename "$dir")" -prune -name "*.md")
is_home="false"; [ "$dir" = "$src" ] && is_home="true"
- target_url="/$rel_dir/index.html"
- [ "$rel_dir" = "." ] && target_url="/index.html"
+ target_url=$(directory_index_url "$rel_dir")
if needs_rebuild "$md_file" "$out_dir/index.html"; then
parse_frontmatter "$md_file"
if [ -n "$fm_content_warning" ]; then
content_out_file="$out_dir/content.html"
- content_rel_url="/$rel_dir/content.html"
- [ "$rel_dir" = "." ] && content_rel_url="/content.html"
+ if [ "$rel_dir" = "." ]; then
+ content_rel_url="/content.html"
+ else
+ content_rel_url="/$(encode_url_path "$rel_dir")/content.html"
+ fi
write_content_warning_outputs "$md_file" "$content_out_file" "$content_rel_url" "$target_url" "$out_dir/index.html" "$is_home"
else
render_markdown "$md_file" "$is_home" "$target_url" > "$out_dir/index.html"
@@ -112,7 +114,8 @@ eval "find \"$src\" \( $IGNORE_ARGS \) -prune -o -type d -print" | sort | while
template.html|site.conf|style.css|styles.root.css|index.md) continue ;;
esac
if [ -d "$entry" ]; then
- echo "${name}|- [${name}/](${name}/index.html)" >> "$temp_entries"
+ dir_url="$(encode_url_path "$name")/index.html"
+ echo "${name}|- [${name}/](${dir_url})" >> "$temp_entries"
elif [ "${entry%.md}" != "$entry" ]; then
label="${name%.md}"
set_post_metadata "$entry" ""
@@ -147,9 +150,11 @@ eval "find \"$src\" \( $IGNORE_ARGS \) -prune -o -type d -print" | sort | while
else
sort_key="$name"
fi
- echo "${sort_key}|- [$label](${name%.md}.html)|$name|${name%.md}.html" >> "$temp_entries"
+ entry_url=$(encode_url_path "${name%.md}.html")
+ echo "${sort_key}|- [$label](${entry_url})|$name|${entry_url}" >> "$temp_entries"
else
- echo "${name}|- [$name]($name)|$name|$name" >> "$temp_entries"
+ asset_url=$(encode_url_path "$name")
+ echo "${name}|- [$name]($asset_url)|$name|$asset_url" >> "$temp_entries"
fi
done
@@ -186,8 +191,7 @@ eval "find \"$src\" \( $IGNORE_ARGS \) -prune -o -type d -print" | sort | while
rm -f "$temp_entries"
is_home="false"; [ "$dir" = "$src" ] && is_home="true"
- target_url="/$rel_dir/index.html"
- [ "$rel_dir" = "." ] && target_url="/index.html"
+ target_url=$(directory_index_url "$rel_dir")
num_items=$(wc -l < "$temp_list")
if [ "$is_posts_dir" = "true" ] && [ -n "$posts_per_page" ] && [ "$posts_per_page" -gt 0 ] && [ "$num_items" -gt "$posts_per_page" ]; then
@@ -289,8 +293,11 @@ eval "find \"$src\" \( $IGNORE_ARGS \) -prune -o -type d -print" | sort | while
if [ -n "$fm_content_warning" ]; then
content_out_file="$out_dir/content.html"
- content_rel_url="/$rel_dir/content.html"
- [ "$rel_dir" = "." ] && content_rel_url="/content.html"
+ if [ "$rel_dir" = "." ]; then
+ content_rel_url="/content.html"
+ else
+ content_rel_url="/$(encode_url_path "$rel_dir")/content.html"
+ fi
write_content_warning_outputs "$temp_index" "$content_out_file" "$content_rel_url" "$target_url" "$out_dir/index.html" "$is_home"
else
render_markdown "$temp_index" "$is_home" "$target_url" > "$out_dir/index.html"
@@ -360,8 +367,8 @@ eval "find \"$src\" \( $IGNORE_ARGS \) -prune -o -type f -print" | sort | while
if needs_rebuild "$file" "$out_file"; then
if [ -n "$fm_content_warning" ]; then
content_out_file="$out/${rel_path%.md}-content.html"
- content_rel_url="/${rel_path%.md}-content.html"
- orig_rel_url="/${rel_path%.md}.html"
+ content_rel_url="/$(encode_url_path "${rel_path%.md}")-content.html"
+ orig_rel_url=$(markdown_file_url "$rel_path")
write_content_warning_outputs "$file" "$content_out_file" "$content_rel_url" "$orig_rel_url" "$out_file" "$is_home"
else
render_markdown "$file" "$is_home" > "$out_file"
@@ -446,7 +453,7 @@ if [ "$generate_feed" = "true" ] && [ -n "$base_url" ]; then
rel_path="${post_file#"$src"}"
rel_path="${rel_path#/}"
- post_url="$base_url_feed/${rel_path%.md}.html"
+ post_url="$base_url_feed$(markdown_file_url "$rel_path")"
if date -u -d "$post_date $post_time" '+%a, %d %b %Y %H:%M:%S +0000' >/dev/null 2>&1; then
pub_date=$(date -u -d "$post_date $post_time" '+%a, %d %b %Y %H:%M:%S +0000')
@@ -497,10 +504,10 @@ if [ "$generate_search" = "true" ] || [ "$generate_tags" = "true" ]; then
if [ "$rel_path" = "index.md" ]; then
md_url="/index.html"
else
- md_url="/${rel_path%/index.md}/index.html"
+ md_url=$(directory_index_url "${rel_path%/index.md}")
fi
else
- md_url="/${rel_path%.md}.html"
+ md_url=$(markdown_file_url "$rel_path")
if [ "$single_file_index" = "true" ]; then
dir_of_file="$(dirname "$md_file")"
rel_dir_of_file="${dir_of_file#"$src"}"
@@ -518,7 +525,7 @@ if [ "$generate_search" = "true" ] || [ "$generate_tags" = "true" ]; then
if [ "$rel_dir_of_file" = "." ]; then
md_url="/index.html"
else
- md_url="/$rel_dir_of_file/index.html"
+ md_url=$(directory_index_url "$rel_dir_of_file")
fi
fi
fi
@@ -528,7 +535,7 @@ if [ "$generate_search" = "true" ] || [ "$generate_tags" = "true" ]; then
parse_frontmatter "$md_file"
[ "$fm_draft" = "true" ] && continue
- markdown_title_from_file "$md_file" "$title - Page"
+ markdown_title_from_loaded_file "$md_file" "$title - Page"
md_heading="$markdown_title"
if [ "$generate_search" = "true" ]; then
diff --git a/lib/config.sh b/lib/config.sh
index d6ce81a..d96b322 100644
--- a/lib/config.sh
+++ b/lib/config.sh
@@ -49,6 +49,7 @@ DEFAULT_TMPL='
{{HEADER_BRAND}}
+ {{HEADER_SEARCH}}
diff --git a/lib/generator.sh b/lib/generator.sh
index 4492657..2e83c38 100644
--- a/lib/generator.sh
+++ b/lib/generator.sh
@@ -117,7 +117,7 @@ render_markdown() {
else
rel_path="${file#"$src"}"
rel_path="${rel_path#/}"
- current_url="/${rel_path%.md}.html"
+ current_url=$(markdown_file_url "$rel_path")
fi
content_file="$file"
@@ -158,7 +158,7 @@ render_markdown() {
"$src/styles.css") style_rel_to_src="styles.css" ;;
"$src/style.css") style_rel_to_src="style.css" ;;
esac
- style_path="/${style_rel_to_src%styles.css}"
+ style_path="/$(encode_url_path "${style_rel_to_src%styles.css}")"
style_path="${style_path%style.css}styles.css"
else
style_path="/styles.css"
@@ -252,13 +252,14 @@ render_markdown() {
final_nav="$nav"
final_header_brand="$header_brand"
+ final_header_search=""
if [ "$search_in_header" = "true" ]; then
- final_header_brand="$header_brand $SEARCH_FORM_HEADER"
+ final_header_search="$SEARCH_FORM_HEADER"
final_nav="$SEARCH_FORM_NAV
$nav"
fi
- ENABLE_HEADER_LINKS="$enable_header_links" CUSTOM_ADMONITIONS="$custom_admonitions" MARKDOWN_SITE_ROOT="$src" MARKDOWN_FALLBACK_FILE="$script_dir/styles/$style.css" sh "$script_dir/markdown.sh" "$content_file" | AWK_LANG="$lang" AWK_CURRENT_URL="$current_url" AWK_TITLE="$page_title" AWK_NAV="$final_nav" AWK_FOOTER="$final_footer" AWK_STYLE_PATH="${style_path}" AWK_HEADER_BRAND="$final_header_brand" AWK_HEAD_EXTRA="$head_extra" AWK_VERSION="$asset_version" AWK_CONTENT_WARNING="$fm_content_warning" awk -f "$awk_dir/render_template.awk" "$local_template"
+ ENABLE_HEADER_LINKS="$enable_header_links" CUSTOM_ADMONITIONS="$custom_admonitions" MARKDOWN_SITE_ROOT="$src" MARKDOWN_FALLBACK_FILE="$script_dir/styles/$style.css" sh "$script_dir/markdown.sh" "$content_file" | AWK_LANG="$lang" AWK_CURRENT_URL="$current_url" AWK_TITLE="$page_title" AWK_NAV="$final_nav" AWK_FOOTER="$final_footer" AWK_STYLE_PATH="${style_path}" AWK_HEADER_BRAND="$final_header_brand" AWK_HEADER_SEARCH="$final_header_search" AWK_HEAD_EXTRA="$head_extra" AWK_VERSION="$asset_version" AWK_CONTENT_WARNING="$fm_content_warning" awk -f "$awk_dir/render_template.awk" "$local_template"
}
generate_content_warning_page() {
_fm_title="$1"
diff --git a/lib/metadata.sh b/lib/metadata.sh
index 35b2825..d83c94c 100644
--- a/lib/metadata.sh
+++ b/lib/metadata.sh
@@ -38,11 +38,9 @@ first_heading_from_markdown() {
grep -m 1 '^# ' "$1" | sed 's/^# *//; s/ *$//'
}
-markdown_title_from_file() {
+markdown_title_from_loaded_file() {
_title_file="$1"
_title_default="$2"
-
- parse_frontmatter "$_title_file"
markdown_title="$fm_title"
if [ -z "$markdown_title" ]; then
@@ -62,6 +60,13 @@ markdown_title_from_file() {
fi
}
+markdown_title_from_file() {
+ _title_file="$1"
+ _title_default="$2"
+ parse_frontmatter "$_title_file"
+ markdown_title_from_loaded_file "$_title_file" "$_title_default"
+}
+
set_post_datetime() {
_raw_date="$1"
_fallback_name="$2"
diff --git a/lib/runtime.sh b/lib/runtime.sh
index ddbf252..0f7c43d 100644
--- a/lib/runtime.sh
+++ b/lib/runtime.sh
@@ -2,6 +2,30 @@ trim_whitespace() {
printf '%s' "$1" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//'
}
+encode_url_path() {
+ printf '%s' "$1" | sed \
+ -e 's/%/%25/g' \
+ -e 's/ /%20/g' \
+ -e 's/#/%23/g' \
+ -e 's/?/%3F/g' \
+ -e 's/"/%22/g' \
+ -e "s/'/%27/g"
+}
+
+markdown_file_url() {
+ _rel_path="$1"
+ printf '/%s.html\n' "$(encode_url_path "${_rel_path%.md}")"
+}
+
+directory_index_url() {
+ _rel_dir="$1"
+ if [ -z "$_rel_dir" ] || [ "$_rel_dir" = "." ]; then
+ printf '/index.html\n'
+ else
+ printf '/%s/index.html\n' "$(encode_url_path "$_rel_dir")"
+ fi
+}
+
append_find_rule() {
_expr="$1"
_rule="$2"
diff --git a/markdown.sh b/markdown.sh
index 1303db2..425ecfd 100755
--- a/markdown.sh
+++ b/markdown.sh
@@ -15,7 +15,7 @@ sed_inplace() {
fi
}
-temp_file="${KEWT_TMPDIR:-/tmp}/markdown.$$.md"
+temp_file=$(mktemp "${KEWT_TMPDIR:-/tmp}/markdown.XXXXXX")
cat "$@" > "$temp_file"
trap 'rm -f "$temp_file" "$temp_file.tmp" "$temp_file.fm"' EXIT INT TERM
@@ -30,7 +30,7 @@ awk -f "$awk_dir/mask_inline_code.awk" "$temp_file" > "$temp_file.tmp" && mv "$t
awk -f "$awk_dir/mask_plain.awk" "$temp_file" > "$temp_file.tmp" && mv "$temp_file.tmp" "$temp_file"
# Reference links
-refs=$(cat "$@" | awk '/^\[[^\]]+\]: */')
+refs=$(awk '/^\[[^\]]+\]: */' "$temp_file")
IFS='
'
for ref in $refs; do
@@ -75,7 +75,7 @@ awk -f "$awk_dir/breaks.awk" "$temp_file" > "$temp_file.tmp" && mv "$temp_file.t
awk -f "$awk_dir/paragraphs.awk" "$temp_file" > "$temp_file.tmp" && mv "$temp_file.tmp" "$temp_file"
# Inline styles
-awk -f "$awk_dir/emoji.awk" "$temp_file" > "$temp_file.tmp" && mv "$temp_file.tmp" "$temp_file"
+awk -v emoji_file="$awk_dir/emoji.tsv" -f "$awk_dir/emoji.awk" "$temp_file" > "$temp_file.tmp" && mv "$temp_file.tmp" "$temp_file"
awk -f "$awk_dir/markdown_inline.awk" "$temp_file" > "$temp_file.tmp" && mv "$temp_file.tmp" "$temp_file"
awk -v input_file="$1" -v site_root="$MARKDOWN_SITE_ROOT" -v fallback_file="$MARKDOWN_FALLBACK_FILE" -v script_dir="$script_dir" -f "$awk_dir/markdown_embed.awk" "$temp_file"
rm "$temp_file"