Skip empty doc files and prune dead type-index entries

- render_header() returns "" when a header has no documented content
  (no /** */ comments on any class, property, function, enum, or delegate)
- generate.py skips writing those files and tracks which were written
- type-index.txt is filtered to only include types from written files,
  preventing dead entries that would cause get_class_overview to fail
- Summary line now reports how many files were skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 10:38:29 -05:00
parent 0bb96dca54
commit 3d075cea20
4 changed files with 25 additions and 9 deletions

View File

@@ -361,14 +361,13 @@ def _render_namespace(ns: NamespaceInfo) -> str:
def render_header(parsed: ParsedHeader,
type_index: dict[str, str] = None,
current_md: str = "") -> str:
"""
Render a ParsedHeader to Markdown. Returns empty string if the header
has no documented content (so callers can skip writing the file).
"""
if type_index is None:
type_index = {}
lines = []
lines.append(f"# `{parsed.filename}`")
lines.append(f"**Module**: `{parsed.module_name}`")
lines.append("")
sections = []
d_sec = _render_delegates(parsed.delegates)
@@ -400,6 +399,13 @@ def render_header(parsed: ParsedHeader,
ff_lines.append(_render_ff_compact(fn))
sections.append('\n'.join(ff_lines))
lines.append('\n\n---\n\n'.join(sections))
if not sections:
return ""
lines = [
f"# `{parsed.filename}`",
f"**Module**: `{parsed.module_name}`",
"",
'\n\n---\n\n'.join(sections),
]
return '\n'.join(lines)