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.

clew/wiki/impactpage.py:120

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
lines 127–127rank = {"product": 0, "threads": 1, "tooling": 2, "tests": 3}lines 128–128ordered = sorted(pages, key=lambda p: (rank.get(p.role or "product", 0), p.title))lines 129–129links = [f'<a href="{text(p.name)}.html">{md_title(p.title)}</a>' for p in ordered]lines 130–130shown = "<br>".join(links[:_SHOWN])lines 131–131rest = links[_SHOWN:]lines 133–133◇ if restlines 134–134shown += f'<details class="more"><summary>{len(rest)} more</summary>{"<br>".join(rest)}</details>'lines 135–135return shown

Requirements

REQ-DDB-WIKI-029

impact_page

str clew.wiki.impactpage.impact_page(Any trace, list pages, Audience rules, Path source)

Write the change-impact page.

clew/wiki/impactpage.py:47

Show on the map →

Called by _build_site

Calls none

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"

Activity · 3 steps
lines 49–58lines = [ "# Change impact", "", _LEAD, "", "```{raw} html", _body(trace, pages, rules), "```", "", ]lines 59–59(Path(source) / "impact.md").write_text("\n".join(lines), encoding="utf-8")lines 60–60return "impact"

Requirements

REQ-DDB-WIKI-024