feat(recipe-report): link recipe names in all story sections (security/needs/routine), not just the lead

_stories() now auto-links whole-word recipe mentions in story titles + bodies to their mirror
repos (same single-pass linkify as the lead); explicit PR/build links are untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
autonomic-bot
2026-06-04 02:21:31 +00:00
parent a6efcec720
commit d8ad5a2805

View File

@ -139,12 +139,13 @@ def _links(links):
f'<a href="{_esc(l["url"])}">{_esc(l["text"])}</a>' for l in links) + "</div>"
def _stories(items):
def _stories(items, repo_url=None):
if not items:
return "<p><em>Nothing this week.</em></p>"
lk = (lambda x: _linkify_recipes(_esc(x), repo_url)) if repo_url else _esc
return "\n".join(
f'<div class="story"><div class="h">{_esc(it.get("title"))}</div>'
f'<div class="b">{_esc(it.get("body"))}</div>{_links(it.get("links"))}</div>' for it in items)
f'<div class="story"><div class="h">{lk(it.get("title"))}</div>'
f'<div class="b">{lk(it.get("body"))}</div>{_links(it.get("links"))}</div>' for it in items)
def _table(rows):
@ -196,9 +197,9 @@ def render(spec_path, out_path):
f'<div class="lead">{lead}</div>')
if s.get("security"):
body += ('<div class="bulletin"><div class="kicker">Security Bulletin</div>'
'<h2>🔒 Critical CVE upgrades — merge first</h2>' + _stories(s["security"]) + "</div>")
body += f'<h2>⚑ Needs attention</h2>{_stories(s.get("needs_attention"))}'
body += f'<h2>Routine</h2><div class="cols">{_stories(s.get("routine"))}</div>'
'<h2>🔒 Critical CVE upgrades — merge first</h2>' + _stories(s["security"], repo_url) + "</div>")
body += f'<h2>⚑ Needs attention</h2>{_stories(s.get("needs_attention"), repo_url)}'
body += f'<h2>Routine</h2><div class="cols">{_stories(s.get("routine"), repo_url)}</div>'
body += f'<h2>The full wire — every recipe</h2>{_table(s.get("table"))}'
body += (f'<footer>The Recipe Report · generated {gen} · '
f'<a href="https://ci.commoninternet.net/">dashboard</a> · <a href="./">archive</a></footer>')