Spaces:
Runtime error
Runtime error
Commit
·
930b95e
1
Parent(s):
f64fe29
unavailable links in red
Browse files
cli.py
CHANGED
@@ -45,7 +45,10 @@ class WikiRunCLI:
|
|
45 |
# Add links to table (3 per row)
|
46 |
row = []
|
47 |
for i, link in enumerate(links):
|
48 |
-
|
|
|
|
|
|
|
49 |
if len(row) == 3:
|
50 |
table.add_row(*row)
|
51 |
row = []
|
|
|
45 |
# Add links to table (3 per row)
|
46 |
row = []
|
47 |
for i, link in enumerate(links):
|
48 |
+
# Check if link is available in the current article
|
49 |
+
is_available = link in self.env.wiki_data
|
50 |
+
color = "green" if is_available else "red"
|
51 |
+
row.append(f"[{color}]{i+1}. {link}[/{color}]")
|
52 |
if len(row) == 3:
|
53 |
table.add_row(*row)
|
54 |
row = []
|