fix: render a single tab without a tab bar

142 tab bars held one tab, most of them "On the device" under a heading saying so. One item now stands alone, led by its label unless it names the place the text around already gives. The network route drops "Run the command on the computer" under the heading "From your computer", which keeps RetroPie in its word budget.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 19:46:22 +01:00
1 parent 124e96cd09
commit 32cc1ce4fa
6 files changed
+39 -4

No files matched your search

+16
View File
@@ -334,6 +334,22 @@ class NoLevelBadgeOnATabRoot(unittest.TestCase):
self.assertNotIn('class="rb-level ', _title_through_heading(_built(page)))
class OneTabIsNoTabBar(unittest.TestCase):
"""142 tab bars held one tab, most of them "On the device" right under
the heading "On the device"."""
def test_a_single_item_stands_alone(self):
import sitemarkup
import siteguides
self.assertEqual(sitemarkup.tabs([("Linux", ["run it"])]), ["**Linux**", "", "run it", ""])
self.assertEqual(sitemarkup.tabs([("", ["run it"])]), ["run it", ""])
self.assertIn('<Tabs syncKey="os">', sitemarkup.tabs([("A", ["a"]), ("B", ["b"])]))
device = "\n".join(siteguides.terminal_tabs(("device",), {}))
self.assertNotIn("<Tab", device)
self.assertNotIn("On the device", device)
class FooterLicenceMatchesTheLicenceFile(unittest.TestCase):
"""The footer said MIT covers the tooling. LICENSE names the metadata too."""
+3 -1
View File
@@ -404,7 +404,9 @@ class AnAppThatReadsAnyBios(unittest.TestCase):
install = self.page[self.page.index("Install this emulator's files"):]
install = install[:install.index("</details>")]
self.assertRegex(install, r"With [^:]+: the installer finds")
self.assertEqual(set(re.findall(r'<TabItem label="([^"]+)">', install)), {"On the device"})
# One place to run it, so no tab bar (one tab offers no choice).
self.assertNotIn("<Tabs", install)
self.assertIn("curl -fsSL", install)
nether = _pages("nethersx2")["nethersx2"]
if "--emulator nethersx2" in nether:
self.assertIn("With ", nether)
+3 -1
View File
@@ -925,7 +925,9 @@ class ARouteWithoutANetwork(unittest.TestCase):
self.assertEqual(siteguides.GUIDES["retropie"].card_run, ("linux",))
text = _plain_page("platforms/retropie.md")
card = text.split("No network?", 1)[1].split("## On the device", 1)[0]
self.assertEqual(_tab_labels(card), {"Linux"})
# One system, so no tab bar: its label leads the command.
self.assertEqual(_tab_labels(card), set())
self.assertIn("**Linux**", card)
def test_no_zip_is_promised_for_an_unmarked_setup(self):
for name in SETUPS: