rommapp_docs/docs/scripts/gen_platforms.py
Claude 11727ce325
docs: scaffold v5.0 overhaul (IA, redirects, generators, workflows)
Lay the foundation for the RomM 5.0 documentation overhaul per the
approved plan in /root/.claude/plans/we-dapper-piglet.md.

Infrastructure:
- pyproject.toml: add mkdocs-redirects, neoteroi-mkdocs, tomli
- mkdocs.yml: wire mkdocs-redirects with full old-URL → new-URL map
  for every page in the existing nav; fix social-plugin .pngg typo
- deploy.yml: only move the `latest` mike alias on `5.*` versions
- deploy-v5-preview.yml: push v5 branch → mike alias `next`
- pr-checks.yml: strict build + redirect-target verification +
  lychee link-check on changed Markdown
- romm-release-bump.yml: nightly auto-PR pinning rommapp/romm to
  the latest release and regenerating snippets

New IA (lowercase-hyphenated, with redirects from old Pascal-case slugs):
- getting-started/, install/, administration/, administration/oidc/,
  using/, platforms/, ecosystem/, developers/, reference/,
  troubleshooting/, releases/, about/
- Navigation.md rewritten end-to-end
- 106 placeholder pages tagged with `wave: 1|2|3` frontmatter

Source-of-truth automation under docs/scripts/:
- sources.toml pins the upstream rommapp/romm ref
- gen_env_vars.py: parses env.template into a sectioned table
  (currently emits 94 vars from master)
- gen_scheduled_tasks.py: emits the 7 scheduled + 3 manual + 1
  watcher task table
- gen_platforms.py: stub awaiting a 5.0 SHA pin
- check_redirects.py: verifies every redirect target exists
  post-build (CI gate)
- scaffold_ia.py: one-shot IA scaffolder (used to generate
  the placeholder pages)

Wired three Wave-1 reference pages to include their generated
snippets via pymdownx.snippets so the integration is provable
end-to-end:
- reference/environment-variables.md
- reference/scheduled-tasks.md
- platforms/supported-platforms.md (placeholder snippet for now)

Verified `mkdocs build --strict` produces zero non-trivial warnings
locally (only git-revision-date warnings on uncommitted files,
which resolve on commit).
2026-04-18 14:24:37 +00:00

38 lines
1.1 KiB
Python

"""Generate the supported-platforms table from rommapp/romm.
Output: docs/resources/snippets/supported-platforms.md
Strategy: fetch backend/utils/generate_supported_platforms.py from upstream
along with the platform metadata it consumes, then exec it in a sandbox.
For now this is a stub that emits a placeholder snippet; the real exec
needs a copy of the upstream utility's input data layout, which we'll wire
up after pinning a 5.0 SHA in sources.toml.
Run manually:
uv run python docs/scripts/gen_platforms.py
"""
from __future__ import annotations
from _sources import write_snippet
PLACEHOLDER = """\
<!-- AUTOGENERATED by docs/scripts/gen_platforms.py — do not edit. -->
<!-- TODO: wire to romm/backend/utils/generate_supported_platforms.py once
a 5.0 SHA is pinned in sources.toml. -->
_Supported-platforms table is generated at build time. Run
`uv run python docs/scripts/gen_platforms.py` to refresh._
"""
def main() -> int:
out = write_snippet("supported-platforms.md", PLACEHOLDER)
print(f"Wrote placeholder to {out}")
return 0
if __name__ == "__main__":
raise SystemExit(main())