| 1051 | clean = clean_parts[1].lstrip("\n") if clean_parts is not None else content |
| 1052 | |
| 1053 | def _build_entity_frontmatter(sources: list[str]) -> str: |
| 1054 | fm_lines = [_yaml_list_line("sources", sources)] |
| 1055 | fm_lines.append(_yaml_kv_line("type", (type_ or "other").title())) |
| 1056 | if brief: |
| 1057 | fm_lines.append(_yaml_kv_line("description", brief)) |
| 1058 | if aliases: |
| 1059 | fm_lines.append(_yaml_list_line("aliases", aliases)) |
| 1060 | return "---\n" + "\n".join(fm_lines) + "\n---\n\n" |
| 1061 | |
| 1062 | if is_update and path.exists(): |
| 1063 | existing = path.read_text(encoding="utf-8") |