impactpage.py¶
clew/wiki/impactpage.py
Change impact, as its own section of the site (round 3, P1g).
_flow_cell
str clew.wiki.impactpage._flow_cell(list pages)
A changed function's flows: product first, five listed, the rest counted.
Source · 18 lines
def _flow_cell(pages: list) -> str:
"""FOUND ON CLEW'S OWN WIKI (round 4): `_build_argparser` sits on dozens of test flows and its
row listed every one. The system's own flows lead; test flows follow; five are listed.
@brief Flow cell.
@return HTML.
"""
rank = {"product": 0, "threads": 1, "tooling": 2, "tests": 3}
ordered = sorted(pages, key=lambda p: (rank.get(p.role or "product", 0), p.title))
links = [f'<a href="{text(p.name)}.html">{md_title(p.title)}</a>' for p in ordered]
shown = "<br>".join(links[:_SHOWN])
rest = links[_SHOWN:]
## V5 (owner Q/A 2026-11-20): the rest open from "N more" rather than being dropped.
if rest:
shown += f'<details class="more"><summary>{len(rest)} more</summary>{"<br>".join(rest)}</details>'
return shown
Activity · 8 steps
Requirements
impact_page
str clew.wiki.impactpage.impact_page(Any trace, list pages, Audience rules, Path source)
Write the change-impact page.
Source · 16 lines
def impact_page(trace: Any, pages: list, rules: Audience, source: Path) -> str:
"""@brief Write impact.md. @return Page name."""
lines = [
"# Change impact",
"",
_LEAD,
"",
"```{raw} html",
_body(trace, pages, rules),
"```",
"",
]
(Path(source) / "impact.md").write_text("\n".join(lines), encoding="utf-8")
return "impact"