From 76f4e230d026e456a9f550ff02a9f25da98eb371 Mon Sep 17 00:00:00 2001 From: Luca Marconato Date: Tue, 17 Nov 2026 22:04:20 +0100 Subject: [PATCH] RFC pages: status line and authors under the title, from the front matter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The authors of each RFC are in its front matter but were shown only in the table on rfcs.md. rfc_header() writes, under the title of every numbered RFC, a status line (RFC n · status · type · created) and the authors, one line per "; …" part (e.g. "Input from …"), styled to stand out (.rfc-authors). Co-Authored-By: Claude Opus 5.5 --- build.py | 30 ++++++++++++++++++++++++++++++ site/_static/css/custom.css | 8 ++++++++ 2 files changed, 38 insertions(+) diff --git a/build.py b/build.py index cf6dcf8..7485977 100644 --- a/build.py +++ b/build.py @@ -204,6 +204,35 @@ def build(version, listed, out, tmp, site_url, strict, preview_pr, preview_of): git("worktree", "remove", "--force", str(src)) +def rfc_header(path, head): + """Write the authors, status, type and creation date of an RFC below its title, from its header.""" + text = path.read_text(encoding="utf-8") + _, front, body = text.split("---\n", 2) + title, rest = body.lstrip("\n").split("\n", 1) + parts = [p.strip() for p in str(head.get("authors", "")).split(";") if p.strip()] + lines = [f"**Authors:** {parts[0]}"] if parts else [] + lines += [p[0].upper() + p[1:] for p in parts[1:]] # e.g. "Input from …" + status = " · ".join( + str(v) + for v in ( + f"RFC {head['rfc']}", + head.get("status"), + head.get("type"), + head.get("created") and f"created {head['created']}", + ) + if v + ) + block = ( + ":::{container} spec-status\n" + + status + + "\n:::\n\n" + + ":::{container} spec-authors rfc-authors\n" + + "\\\n".join(lines) + + "\n:::\n" + ) + path.write_text(f"---\n{front}---\n\n{title}\n\n{block}\n{rest}", encoding="utf-8") + + def rfc_table(docs): """The table of RFCs on rfcs.md, from the headers of the numbered files in rfcs/ (not the template); a field missing from a header leaves its cell empty.""" @@ -212,6 +241,7 @@ def rfc_table(docs): rows = [] for path in sorted((docs / "rfcs").glob("[0-9]*.md")): head = yaml.safe_load(path.read_text(encoding="utf-8").split("---\n", 2)[1]) + rfc_header(path, head) rows.append( f"| {head['rfc']} | {{doc}}`{head['title']} ` | {head.get('type', '')} " f"| {head.get('authors', '')} | {head.get('status', '')} | {head.get('created', '')} |" diff --git a/site/_static/css/custom.css b/site/_static/css/custom.css index 1fb44f7..ffcd62b 100644 --- a/site/_static/css/custom.css +++ b/site/_static/css/custom.css @@ -380,3 +380,11 @@ h1 img.heading-icon { html[data-theme="dark"] .bd-content img.github-icon { filter: invert(1); } + +/* Authors of an RFC, below its title (build.py rfc_header): very visible */ +.rfc-authors { + color: var(--pst-color-text-base); + font-size: 1.1rem; + border-left: 3px solid var(--pst-color-primary); + padding-left: 0.75rem; +}