MCPcopy Create free account
hub / github.com/DevCloudNinjas/DevOps-Projects / write_catalog_overrides

Function write_catalog_overrides

tools/build_starlight_content.py:1214–1273  ·  view source on GitHub ↗
(projects: list[dict])

Source from the content-addressed store, hash-verified

1212
1213
1214def write_catalog_overrides(projects: list[dict]) -> None:
1215 by_cost = {
1216 "low": [project for project in projects if project["cost_risk"] == "low"],
1217 "medium": [project for project in projects if project["cost_risk"] == "medium"],
1218 "high": [project for project in projects if project["cost_risk"] == "high"],
1219 }
1220 row_lines = []
1221 for project in projects:
1222 row_lines.append(
1223 f"| {project['number']:02d} | "
1224 f"[{project['name']}]({project_path(project)}) | "
1225 f"{project['skill_level']} | {project['time_estimate']} | "
1226 f"{project['cost_risk']} | {project['works_locally']} | "
1227 f"{project['needs_cloud_credentials']} | {project['cleanup_available']} | "
1228 f"{', '.join(project['tools'][:4])} |"
1229 )
1230 rows = "\n".join(row_lines)
1231 goal_cards = "\n".join(
1232 f""" <a class="path-card" href="{site_path(route['href'])}">
1233 <strong>{escape_html(route['label'])}</strong>
1234 <p>{escape_html(route['summary'])}</p>
1235 <small>{escape_html(route['proof'])}</small>
1236 </a>"""
1237 for route in START_ROUTES
1238 )
1239 quick = "\n".join(
1240 f"- **{cost.title()} cost:** "
1241 + ", ".join(
1242 f"[{project['number']:02d}]({project_path(project)})"
1243 for project in items[:12]
1244 )
1245 for cost, items in by_cost.items()
1246 if items
1247 )
1248 picker_description = (
1249 "Choose DevOps projects by cost, deployability, and stack "
1250 "without leaving the portal."
1251 )
1252 content = f"""{frontmatter("Project Picker", description=picker_description)}
1253Use this picker when you know your constraint. Every project link opens an internal guide page.
1254
1255## Start By Goal
1256
1257<div class="path-grid">
1258{goal_cards}
1259</div>
1260
1261## Fast Picks
1262
1263{quick}
1264
1265## All Projects
1266
1267| # | Project | Level | Time | Cost | Local | Cloud Credentials | Cleanup | Tools |
1268| --- | --- | --- | --- | --- | --- | --- | --- | --- |
1269{rows}
1270"""
1271 path = TARGET_DOCS / "catalog" / "project-picker.md"

Callers 1

mainFunction · 0.85

Calls 4

project_pathFunction · 0.85
site_pathFunction · 0.85
escape_htmlFunction · 0.85
frontmatterFunction · 0.85

Tested by

no test coverage detected