--- import platform from '../data/platform.json'; /** * A worked example that belongs to one game, quoted on a core page (PLAN.md §16, D68). * * D63 keeps a game's vocabulary inside that game's section, but a core page sometimes needs a * real example rather than an invented one: a module manifest, an event dimension, the flag * that tells the installer which game it is setting up. §1 prefers the real thing, because an * invented example is checked by nothing and goes stale without anybody noticing. * * So the example keeps its game's words and says whose they are. This prints the game's name * above the block — the same bargain D67 strikes for a screenshot: a game's words are honest * on a core page when the game is named right beside them. `scripts/checkTerms.mjs` reads the * `game` attribute and allows that game's words, and only that game's, between the tags. * * The name comes from `platform.json` rather than from the caller, so the label cannot say * one game while the attribute that the check reads says another. */ interface Props { /** A key of `platform.json`'s `games`: `uo` or `rust`. */ game: keyof typeof platform.games; } const { game } = Astro.props; const entry = platform.games[game]; if (!entry) { throw new Error( `GameExample: unknown game "${game}". Use a key of platform.json's games: ${Object.keys(platform.games).join(', ')}.`, ); } ---
{entry.name}