#!/usr/bin/env python3 from collections import defaultdict import json # Load and group emoji data with open('emoji.json', 'r') as f: emoji_data = json.loads(f.read()) groups = defaultdict(list) for k, details in emoji_data.items(): groups[details['category']].append((k, details)) # Define category order category_order = [ {'id': 'people', 'name': 'Smileys & People', 'icon': '1f604'}, {'id': 'nature', 'name': 'Animals & Nature', 'icon': '1f426'}, {'id': 'food', 'name': 'Food & Drink', 'icon': '1f354'}, {'id': 'activity', 'name': 'Activity', 'icon': '26bd'}, {'id': 'travel', 'name': 'Travel & Places', 'icon': '2708'}, {'id': 'objects', 'name': 'Objects', 'icon': '1f4a1'}, {'id': 'symbols', 'name': 'Symbols', 'icon': '1f523'}, {'id': 'flags', 'name': 'Flags', 'icon': '1f1ec-1f1e7'}, ] # Helper functions def make_hexchar(codepoint): return '%s;' % codepoint.replace('-', ';') # Generate HTML print('