Skip to content

Navigation Menu

Sign in
Sign up

docs: document the built-in platform folder aliases - #137

Merged
gantoine merged 5 commits into
main from
claude/platform-slug-docs-7rads7
Sep 11, 2026
Merged

docs: document the built-in platform folder aliases #137
gantoine merged 5 commits into
main from
claude/platform-slug-docs-7rads7

Conversation

@sdornan

@sdornan sdornan commented Sep 11, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Description

Follows the platform slug work in rommapp/romm (unreleased, lands with the next tag). RomM now:

  • resolves 138 folder names Batocera, RetroBat and ES-DE use (megadrive/, gamecube/, n3ds/, mame/, easyrpg/, ...) with no system.platforms binding,
  • matches folder names case-insensitively on both sides of a binding,
  • ships an rpg-maker platform for the easyrpg/ folder those frontends all carry.

The docs still told readers every platform folder has to be named after a slug, which is now wrong in the common case, and two of the remap examples were stale: gc is a built-in alias (so gc: "ngc" changes nothing), and psx: "ps" pointed at ps, which has never been a RomM slug (the PlayStation slug is psx, and ps/ is now an alias for it).

What changed

  • platforms/supported-platforms.md: new Folder name aliases section, carrying a generated table plus the two caveats that bite — a binding always overrides an alias, and a folder name that is itself a slug never reaches the alias table.
  • reference/configuration-file.md (system.platforms): reframed as "for folders RomM doesn't recognise or gets wrong", documented the case-insensitive matching and the binding → slug → alias order, replaced the two stale examples.
  • getting-started/folder-structure.md, platforms/custom-platforms.md, about/faqs.md, troubleshooting/index.md, reference/glossary.md: pointed at the new section, pspsx in the glossary.
  • scripts/gen_platform_aliases.py + docs/resources/snippets/platform-aliases.md + romm-release-bump.yml: the alias table is generated and regenerates on the release bump, per review.

The generator

gen_platform_aliases.py fetches platform_aliases.py and platform_slugs.py from the pinned ref and parses them with ast, rather than shelling out to a romm-side script the way gen_platforms.py does. The alias table is a plain dict literal, so nothing needs importing, which means no romm checkout, no romm-side script and no cross-repo sequencing. It runs on bare stdlib. Output is 138 folder names over 103 platforms, grouped so folders sharing a target sit on one row and the many-to-one mappings stay visible.

The pin is 5.2.0, which predates the alias table, so the committed snippet was seeded with --ref master; the next bump regenerates it from the pin. Against a ref without the file the generator warns, leaves the committed table untouched and exits 0 — a missing alias table costs the alias table, not the whole bump PR (see the review thread; the earlier exit-1 behaviour would have taken the env-var and scheduled-task updates down with it).

Separately, and not fixed here: gen_platforms can't currently run in romm-release-bump.yml, because it needs ROMM_SRC and that job neither checks romm out nor sets it. Worth noting the workflow's 11 green runs all took the changed=false no-op path, so the regenerate step has never actually executed — this fires on the first real release bump. Flagged in the review thread; happy to fix in its own PR.

The atari800 case

Resolution checks the slug list before the alias table, so a folder name that already is a slug never reaches the aliases. ES-DE and Batocera use atari800/ for the whole Atari 8-bit family, but atari800 is RomM's slug for the Atari 800 alone, so it still needs an explicit binding. Both shipped example configs carry it.

Checks

  • uv run mkdocs build --strict clean; the #folder-name-aliases anchor, its 7 inbound links, and the included snippet all verified in the built HTML
  • uv run python -m scripts.check_redirects — all 46 targets exist
  • prettier, markdownlint and yamllint clean under the repo configs; remaining markdownlint findings are pre-existing MD033 in untouched regions
  • generator verified both ways: against 5.2.0 it warns and leaves the snippet byte-identical; against a ref carrying the table its output matches the committed snippet byte-for-byte
  • spot-checked against the source: all 13 arcade folders match PLATFORM_FS_ALIASES exactly

Note on timing

This documents behaviour that is on master but not in a released tag yet. Merging now follows the filesystem.structure precedent (documented here Sep 10, feature landed Sep 8); happy to hold it until the next release instead if you'd rather the site only describe shipped versions.

AI assistance disclosure

Written with Claude Code. The alias table, resolution order, slug values and folder-name claims were each checked against backend/utils/platform_aliases.py and backend/utils/platform_slugs.py; a human should still review the wording.

Companion example-config tweak: rommapp/romm#4461 (merged).

🤖 Generated with Claude Code

https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2

RomM now resolves the folder names Batocera, RetroBat and ES-DE use
without a system.platforms binding, and matches folder names
case-insensitively. The docs still told readers every folder had to be
named after a slug, and two of the remap examples were stale: gc is an
alias now, and "ps" was never a PlayStation slug.
Add a Folder name aliases section to Supported Platforms covering the
resolution order and the folders that collapse onto one platform, and
point Folder Structure, Custom Platforms, the FAQ, troubleshooting and
the glossary at it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2 
A folder name that already is a slug matches itself before the alias
table is consulted, so a frontend meaning something else by that name
still needs a binding. ES-DE and Batocera use atari800/ for the whole
Atari 8-bit family, while atari800 is the Atari 800 alone.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2 
Comment thread docs/platforms/supported-platforms.md Outdated
Comment thread docs/reference/configuration-file.md Outdated
Drop the numbered-step cross-references and the bulleted "things to
know" scaffolding, and say each fact once.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2 
sdornan and others added 2 commits September 11, 2026 17:17
The hand-picked sample would drift every time the alias table changed
upstream. Generate the full table instead, and regenerate it on the
release bump alongside the platform table.
The generator parses platform_aliases.py and platform_slugs.py with ast
rather than importing them, so unlike gen_platforms it needs no romm
checkout and runs anywhere. Folder names sharing a target are grouped
onto one row, which keeps the many-to-one mappings visible.
The pinned ref predates the alias table, so the committed snippet is
seeded with --ref master; the next bump regenerates it from the pin.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2 
Exiting non-zero failed the whole regenerate step, so a ref without an
alias table would have cost the release bump its env-var and
scheduled-task updates too, which is the staleness this workflow exists
to prevent. Keep the committed table and warn instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172ovkiqiK6JgEYCmi3uqe2 
gantoine merged commit 2b2135e into main Sep 11, 2026
4 checks passed
gantoine deleted the claude/platform-slug-docs-7rads7 branch September 11, 2026 20:37
gantoine added a commit that referenced this pull request Sep 11, 2026
The platform folder-alias work on main (#137) overlapped
`system.platforms` in the config reference. Main's version documents the
whole resolution order and links the generated alias table, which
supersedes the one-line Batocera/RetroBat/ES-DE note this branch added,
so the conflict is resolved in its favour.
Scanning & Watcher's platform-folder section is repointed at that alias
table for the same reason. Regenerating all four snippets at this
branch's pin reproduces the merged files exactly, so the alias table
needs no bump.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gantoine gantoine gantoine approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /