|
7 | 7 | * builds timestamps.json, which provides metadata about the specs |
8 | 8 | """ |
9 | 9 |
|
| 10 | +import glob |
10 | 11 | import json |
11 | 12 | import os |
12 | 13 | import os.path |
@@ -174,6 +175,8 @@ def escape_html(text): |
174 | 175 |
|
175 | 176 | metadata["dir"] = entry.name |
176 | 177 | 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] |
177 | 180 | specgroups[metadata["shortname"]].append(metadata) |
178 | 181 |
|
179 | 182 | # Reorder the specs with common shortname based on their level (or year, for |
@@ -231,10 +234,18 @@ def escape_html(text): |
231 | 234 | ts = timestamps.get(dir_name) |
232 | 235 | date_str = format_timestamp(ts) if ts else "" |
233 | 236 |
|
| 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 | + |
234 | 245 | indent_class = ' class="grouped-spec"' if is_group else "" |
235 | 246 | rows.append( |
236 | 247 | 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' |
238 | 249 | f' <td>{date_str}</td>\n' |
239 | 250 | f' </tr>' |
240 | 251 | ) |
@@ -297,6 +308,10 @@ def escape_html(text): |
297 | 308 | .grouped-spec td:first-child {{ |
298 | 309 | padding-left: 2em; |
299 | 310 | }} |
| 311 | + .issues {{ |
| 312 | + font-size: 0.85em; |
| 313 | + color: #666; |
| 314 | + }} |
300 | 315 | </style> |
301 | 316 | </head> |
302 | 317 | <body> |
|
0 commit comments