From ef83cced04aaac29c2e448c4fbd6ab3a853a7f90 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Fri, 27 Jun 2025 11:36:00 +0400 Subject: [PATCH 1/2] read and display data related to the CG spec transition plan if any --- bikeshed/boilerplate.py | 13 +++++++++++++ bikeshed/metadata.py | 2 ++ 2 files changed, 15 insertions(+) diff --git a/bikeshed/boilerplate.py b/bikeshed/boilerplate.py index 476b2ff945..4ad0dabc94 100644 --- a/bikeshed/boilerplate.py +++ b/bikeshed/boilerplate.py @@ -2,6 +2,7 @@ import copy import dataclasses +import json import os import re import subprocess @@ -30,6 +31,18 @@ def loadBoilerplate(doc: t.SpecT, filename: str, bpname: str | None = None) -> N bpname = filename html = retrieve.retrieveBoilerplateFile(doc, filename) el = boilerplateFromHtml(doc, html, context=f"{filename} boilerplate") + if doc.md.cgTransitionPlan == True and filename == "status": + p = os.path.join(doc.inputSource.directory(), "cg-monitor.json") + with open(p, 'r') as f: + data = json.load(f) + + html = "
" + html += "

Transition status: " + data["transition_status"] + "

" + html += "

Target organization ("+ data["intended_organization"] +") / group (" + data["intended_group"] + ")

" + for note in data["notes"]: + html += "

" + note + "

" + html += "
" + el.append(h.parseHTML(html)) fillWith(bpname, el, doc=doc) diff --git a/bikeshed/metadata.py b/bikeshed/metadata.py index 04a5041214..0e6b8a8668 100644 --- a/bikeshed/metadata.py +++ b/bikeshed/metadata.py @@ -66,6 +66,7 @@ def __init__(self) -> None: self.boilerplate: config.BoolSet = config.BoolSet(default=True) self.canIUseURLs: list[str] = [] self.canonicalURL: str | None = None + self.cgTransitionPlan: bool = False self.complainAbout: config.BoolSet = config.BoolSet(["mixed-indents"]) self.customTextMacros: list[tuple[str, str]] = [] self.customWarningText: list[str] = [] @@ -1395,6 +1396,7 @@ def parseLiteralList(key: str, val: str, lineNum: str | int | None) -> list[str] "Boilerplate": Metadata("Boilerplate", "boilerplate", joinBoolSet, parseBoilerplate), "Can I Use Url": Metadata("Can I Use URL", "canIUseURLs", joinList, parseLiteralList), "Canonical Url": Metadata("Canonical URL", "canonicalURL", joinValue, parseLiteral), + "Community Group Transition Plan": Metadata("CG Transition Plan", "cgTransitionPlan", joinValue, parseBoolean), "Complain About": Metadata("Complain About", "complainAbout", joinBoolSet, parseComplainAbout), "Custom Warning Text": Metadata( "Custom Warning Text", From 1e5bf40a228181a09b4fc62f6b88af1bde72bdda Mon Sep 17 00:00:00 2001 From: "Tab Atkins Jr." Date: Fri, 27 Jun 2025 10:54:04 -0700 Subject: [PATCH 2/2] Update bikeshed/boilerplate.py --- bikeshed/boilerplate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bikeshed/boilerplate.py b/bikeshed/boilerplate.py index 4ad0dabc94..fe2c3b062f 100644 --- a/bikeshed/boilerplate.py +++ b/bikeshed/boilerplate.py @@ -31,7 +31,7 @@ def loadBoilerplate(doc: t.SpecT, filename: str, bpname: str | None = None) -> N bpname = filename html = retrieve.retrieveBoilerplateFile(doc, filename) el = boilerplateFromHtml(doc, html, context=f"{filename} boilerplate") - if doc.md.cgTransitionPlan == True and filename == "status": + if doc.md.cgTransitionPlan and filename == "status": p = os.path.join(doc.inputSource.directory(), "cg-monitor.json") with open(p, 'r') as f: data = json.load(f)