diff --git a/scripts/generate_site.py b/scripts/generate_site.py index d6bf5b780..660c58ac5 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -417,8 +417,8 @@ def _date_line() -> str: def _stat(value: str, label: str) -> list[str]: return [ markup.block_open("div", 'class="rb-stat"'), - f'{value}', - f'{label}', + # One line, a space between: the page text read "168/168Coverage". + f'{value} {label}', "", "", ] @@ -3803,8 +3803,10 @@ def _platform_file_row(f: dict, cfg_entry: dict, hash_type: str = "", facts.append(_inline_html(_category_evidence_md(f["category_evidence"], launched))) path = _row_path(fname, cfg_entry) - summary = (_text_html(fname) + (f"{_text_html(path)}" if path else "") - + _status_chip(f)) + # Spaces between name, path and status: the summary lays them out as + # columns, and the page text read "SVI603.ROMbios/Machines/...OK". + summary = " ".join([_text_html(fname), *([f"{_text_html(path)}"] if path else []), + _status_chip(f)]) copy = _copy_hash(shown, hashes[shown]) if shown else "" return (f'
{summary}' f'{"
".join(facts)}
{copy}') diff --git a/scripts/sitemarkup.py b/scripts/sitemarkup.py index e440d5cc5..664266ff2 100644 --- a/scripts/sitemarkup.py +++ b/scripts/sitemarkup.py @@ -225,10 +225,11 @@ def _tile_mark(name: str, logo: str, lazy: bool = False) -> str: loading = ' loading="lazy"' if lazy else "" return (f'') - # The same square as a logo, drawn on white like the logos are. - return ('') + # The same square as a logo, drawn on white like the logos are. The + # letters are the stylesheet's (::before), not text of the page: the + # tile's name follows, and a copy or a text dump read "MMMyMinUI". + return (f'') # Tiles in the first row of a grid at its widest, two columns of 15rem in @@ -246,8 +247,8 @@ def platform_tiles(tiles: list[tuple[str, str, str, str]], eager: int = 0) -> li links = "".join( f'' f"{_tile_mark(name, logo, lazy=index >= eager)}" - f'{html.escape(name)}' - f'{inline_html(runs_on)}' + f'{html.escape(name)} ' + f'{inline_html(runs_on)} ' for index, (name, target, logo, runs_on) in enumerate(tiles) ) return [f'
{links}
', ""] diff --git a/tests/test_site_components.py b/tests/test_site_components.py index 7385e7ff5..e89ddceb6 100644 --- a/tests/test_site_components.py +++ b/tests/test_site_components.py @@ -328,7 +328,7 @@ class TitleLogoOnAPlate(unittest.TestCase): # written, the tile's and the title's. import sitemarkup # noqa: PLC0415 - self.assertRegex(sitemarkup._tile_mark("MyMinUI", ""), r"]*>.*>MM") + self.assertIn('data-initials="MM" aria-hidden="true">', sitemarkup._tile_mark("MyMinUI", "")) component = _read(REPO_ROOT / "website" / "src" / "components" / "PageTitle.astro") self.assertIn("{initials(setup.name)}", component) diff --git a/tests/test_site_entry.py b/tests/test_site_entry.py index cd1c1ac55..557c67f27 100644 --- a/tests/test_site_entry.py +++ b/tests/test_site_entry.py @@ -160,7 +160,7 @@ class SetupTiles(unittest.TestCase): def test_a_setup_without_a_logo_shows_its_initials(self): self.assertEqual(sitemarkup.initials("MyMinUI"), "MM") tile = "".join(sitemarkup.platform_tiles([("MyMinUI", "x.md", "", "Handhelds")])) - self.assertIn(">MM", tile) + self.assertIn('data-initials="MM"', tile) tile = "".join(sitemarkup.platform_tiles([("RomM", "x.md", "logo.png", "A server")])) self.assertIn('IPL.bindolphin-emu/Sys/GC/{region}/" + self.assertIn(f"IPL.bin dolphin-emu/Sys/GC/{region}/ " 'OK', "\n".join(lines)) diff --git a/tests/test_site_platform_density.py b/tests/test_site_platform_density.py index 1f09510f9..48519e3f7 100644 --- a/tests/test_site_platform_density.py +++ b/tests/test_site_platform_density.py @@ -97,7 +97,7 @@ class ARowPerFile(unittest.TestCase): {"name": "bios_a.bin", "md5": md5, "sha1": sha1, "crc32": "0badf00d", "destination": "bios/bios_a.bin"}) # The summary is the row: the name, its folder, the status. - self.assertIn('
bios_a.binbios/' + self.assertIn('
bios_a.bin bios/ ' 'OK', row) # The hash the platform checks, short, on one button beside the # summary (a summary is a control: no button inside it). @@ -113,7 +113,7 @@ class ARowPerFile(unittest.TestCase): def test_a_file_at_the_root_prints_no_path(self): for destination in ("", "x.bin"): row = self._row({"name": "x.bin", "status": "ok"}, {"destination": destination}) - self.assertIn("x.binx.bin