#!/usr/bin/env python """Render the full world map as an HTML page.""" import sys import tomllib import webbrowser from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent / "src")) from mudlib.world.terrain import World ROOT = Path(__file__).parent.parent def main(): config_path = ROOT / "worlds" / "earth" / "config.toml" with open(config_path, "rb") as f: config = tomllib.load(f) seed = config["world"]["seed"] width = config["world"]["width"] height = config["world"]["height"] name = config["world"]["name"] print(f"generating {name} ({width}x{height}, seed={seed})...") world = World(seed=seed, width=width, height=height) # encode terrain as compact string, one char per tile rows = ["".join(row) for row in world.terrain] terrain_data = "\\n".join(rows) html = f"""