feat: show the installer demo on readme and site

The README shows the GIF under the commands. The home page and Get your
files show the video through InstallDemo.astro: nothing is fetched until
it is on screen, reduced motion and Save-Data keep the poster with a play
button, and a description is read to screen readers.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 20:46:07 +01:00
1 parent e310723893
commit 65a5dfecc7
7 files changed
+325 -2

No files matched your search

+22
View File
@@ -82,6 +82,8 @@ from generate_readme import (
NO_PACK,
asset_links,
contributing_text,
demo_description,
demo_facts,
download_links,
extract_notes,
extract_targets,
@@ -555,6 +557,7 @@ def generate_home(
"**Run one command.** Some setups have a ZIP.",
"**Start a game.**",
]),
*install_demo(),
"## Pick your device",
"",
*setup_picker(registry, display),
@@ -4188,6 +4191,20 @@ def first_screen_words() -> list[str]:
f"and **{installer.TUI_FOLDER_TITLE}**), then offers **{installer.TUI_INSTALL_ROW}**."]
# The demo files the site serves (docs_assets/demo/, scripts/make_demo.py):
# the GIF is the README's, the tape and demo.json are inputs.
DEMO_ASSETS = ("install.webm", "install.mp4", "install.png")
def install_demo() -> list[str]:
"""The installer demo: a video that loads once it is on screen, its
description for screen readers."""
facts = demo_facts()
text = html.escape(demo_description(facts), quote=True)
return [f'<InstallDemo description="{text}" width="{facts["width"]}" '
f'height="{facts["height"]}" />', ""]
def check_pass_line() -> str:
"""The pass line of "How to check": the words `--check` prints only when
no file is missing or wrong (install.py EVERYTHING_IN_PLACE), read from
@@ -12117,6 +12134,7 @@ def generate_which_pack() -> str:
"",
*first_screen_words(),
"",
*install_demo(),
*trust_box(""),
"**Check your folder later.** Add `--check`. It changes nothing.",
"",
@@ -12476,6 +12494,10 @@ def _generate(args: argparse.Namespace) -> None:
source = Path("docs_assets") / folder
if source.is_dir():
shutil.copytree(source, public / "assets" / dest, dirs_exist_ok=True)
demo_dest = public / "assets" / "demo"
demo_dest.mkdir(parents=True, exist_ok=True)
for name in DEMO_ASSETS:
shutil.copy2(Path("docs_assets") / "demo" / name, demo_dest / name)
assets_src = Path(".github") / "assets"
for name, dest_name in [("logo.png", "logo.png"), ("favicon.png", "favicon.png")]:
src = assets_src / name