MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / format_node_refs

Function format_node_refs

graphify/callflow_html.py:1214–1229  ·  view source on GitHub ↗

Render node references as readable labels instead of internal IDs.

(node_ids: set, node_by_id: dict, lang: str, empty_text: str, limit: int = 3)

Source from the content-addressed store, hash-verified

1212
1213
1214def format_node_refs(node_ids: set, node_by_id: dict, lang: str, empty_text: str, limit: int = 3) -> str:
1215 """Render node references as readable labels instead of internal IDs."""
1216 if not node_ids:
1217 return escape(empty_text)
1218 parts = []
1219 for nid in sorted(node_ids, key=lambda item: node_display_name(node_by_id.get(item), item).lower())[:limit]:
1220 node = node_by_id.get(nid)
1221 label = node_display_name(node, nid)
1222 source = safe_file_path((node or {}).get("source_file", ""))
1223 if source:
1224 parts.append(f"<code>{escape(label)}</code><br><small style=\"color:var(--muted)\">{escape(source)}</small>")
1225 else:
1226 parts.append(f"<code>{escape(label)}</code>")
1227 if len(node_ids) > limit:
1228 parts.append(escape(pick_text(lang, f"+{len(node_ids) - limit} 个更多", f"+{len(node_ids) - limit} more")))
1229 return "<br>".join(parts)
1230
1231
1232def generate_call_table_rows(

Callers 1

generate_call_table_rowsFunction · 0.85

Calls 5

node_display_nameFunction · 0.85
safe_file_pathFunction · 0.85
pick_textFunction · 0.85
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected