diff --git a/scripts/board.py b/scripts/board.py index cfdaecb..fd7d299 100644 --- a/scripts/board.py +++ b/scripts/board.py @@ -1272,13 +1272,6 @@ def _render_html_index(snap: dict) -> str: files = snap.get("files") or [] ov = snap.get("overrides") or [] found = [s for s in snap.get("sources") or [] if s.get("found")] - stats = t_.stats((len(files), "files"), (len(found), "sources"), - (sum(len(f["keys"]) for f in files), "keys"), - (len(ov), "overrides"), (len(orphans(snap)), "orphaned"), - (sum(len(v) for v in unused_keys(snap).values()), - "possibly unused"), - (len(snap.get("env_vars") or []), "env vars")) \ - if hasattr(t_, "stats") else "" rows = [] for s in snap.get("sources") or []: name = (f"{_esc(s['repo'])}" @@ -1293,7 +1286,7 @@ def _render_html_index(snap: dict) -> str: f"
| Repo | Kind"
+ overview = ("Sources
Override mapEach workspace file against " + " Override mapEach workspace file against " "the same path across its library stack, in autonerves lookup " "order (e.g. lens → galaxy → array → fit). " "differs the workspace changes the value the libraries give; " @@ -1330,7 +1323,7 @@ def _render_html_index(snap: dict) -> str: tooling = [f for f in files if f.get("tooling")] tool_html = "" if tooling: - tool_html = (" Workspace tooling" + tool_html = (" Workspace tooling"
"
Environment variablesThe " + env_html = (" Environment variablesThe "
"
Unparseable files
Unparseable files
Possibly unused config keys" + unused_html = (" Possibly unused config keys" + _esc(UNUSED_CAVEAT).replace("`", "").replace("*", "") + " " + "".join(groups)) elif snap.get("lookups"): - unused_html = ("Possibly unused config keys" + unused_html = (" Possibly unused config keys" "none — every library settings key is read. ") errors = "" if snap.get("errors"): @@ -1388,13 +1381,25 @@ def _render_html_index(snap: dict) -> str: gh_link = f' · GitHub' if gh else "" lede = ("Every config file and option across the libraries and the " "workspaces that override them — read-only.") - body = f"""{t_.hero(BOARD_KEY, "Board", lede)} + navigation = [ + {"href": "#search", "label": "Search keys", "count": sum(len(f["keys"]) for f in files)}, + {"href": "#sources", "label": "Sources", "count": len(found)}, + ] + for target, label, count, present in [ + ("overrides", "Overrides", len(ov), override), + ("unused", "Possibly unused", sum(len(v) for v in unused.values()), unused_html), + ("problems", "Unparseable files", len(parse_errors(snap)), problems), + ("environment", "Environment variables", len(snap.get("env_vars") or []), env_html), + ("tooling", "Workspace tooling", len(tooling), tool_html), + ]: + if present: + navigation.append({"href": "#" + target, "label": label, "count": count}) + body = f"""{t_.hero(BOARD_KEY, "Board", lede, navigation=navigation)}{st.upper()} {_esc(_summary(snap))} -{stats}markdown version · board.json{gh_link} -Search+Search@@ -1504,7 +1509,7 @@ def _render_html_repo(snap: dict, name: str) -> str: groups.setdefault(d, []).append(f) parts = [] for d in sorted(groups, key=lambda g: (g != "(top level)", g)): - parts.append(f"{_esc(d)} "
+ parts.append(f"{_esc(d)} " f"({len(groups[d])})" + "".join( _file_html(snap, f, ovs.get(f["path"])) for f in groups[d]) + " |
|---|