Skip to content

Commit 2ff7cbc

Browse files
Link to Disposition of Comments from the index page
For each spec that has issues-*.html files (Disposition of Comments documents), show links to them below the spec title.
1 parent 25f166e commit 2ff7cbc

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

bin/build-index.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* builds timestamps.json, which provides metadata about the specs
88
"""
99

10+
import glob
1011
import json
1112
import os
1213
import os.path
@@ -174,6 +175,8 @@ def escape_html(text):
174175

175176
metadata["dir"] = entry.name
176177
metadata["currentWork"] = False
178+
issues_files = sorted(glob.glob(os.path.join(entry.path, "issues-*.html")))
179+
metadata["issues"] = [os.path.basename(f) for f in issues_files]
177180
specgroups[metadata["shortname"]].append(metadata)
178181

179182
# Reorder the specs with common shortname based on their level (or year, for
@@ -231,10 +234,18 @@ def escape_html(text):
231234
ts = timestamps.get(dir_name)
232235
date_str = format_timestamp(ts) if ts else ""
233236

237+
issues_html = ""
238+
if spec["issues"]:
239+
links = []
240+
for fname in spec["issues"]:
241+
label = fname.replace("issues-", "").replace(".html", "")
242+
links.append(f'<a href="./{dir_name}/{fname}">{label}</a>')
243+
issues_html = '<br><span class="issues">DoC: ' + " \u00b7 ".join(links) + '</span>'
244+
234245
indent_class = ' class="grouped-spec"' if is_group else ""
235246
rows.append(
236247
f' <tr{indent_class}>\n'
237-
f' <td><a href="./{dir_name}/">{title}</a>{current_label}</td>\n'
248+
f' <td><a href="./{dir_name}/">{title}</a>{current_label}{issues_html}</td>\n'
238249
f' <td>{date_str}</td>\n'
239250
f' </tr>'
240251
)
@@ -297,6 +308,10 @@ def escape_html(text):
297308
.grouped-spec td:first-child {{
298309
padding-left: 2em;
299310
}}
311+
.issues {{
312+
font-size: 0.85em;
313+
color: #666;
314+
}}
300315
</style>
301316
</head>
302317
<body>

0 commit comments

Comments
 (0)