1
0
mirror of https://codeberg.org/fediverse/fep.git synced 2026-08-05 19:55:46 +00:00
Files
fep/scripts/fep_tools/site_overview_page.py
T
silverpill f68a69fc79 Website: Display proposal type and implementation counts in table (#747)
This PR addresses https://codeberg.org/fediverse/fep/issues/686 and https://codeberg.org/fediverse/fep/issues/194

The "Type" column is added to all FEP lists, the value is either "informational" or "implementation (N)".

Reviewed-on: https://codeberg.org/fediverse/fep/pulls/747
Reviewed-by: helge <helge@noreply.codeberg.org>
Co-authored-by: silverpill <silverpill@firemail.cc>
Co-committed-by: silverpill <silverpill@firemail.cc>
2026-03-07 17:43:33 +01:00

42 lines
948 B
Python

from . import index, table_for_feps
markdown_frontmatter = """---
hide:
- toc
- navigation
---
"""
def columns_for_status(status: str) -> list[str]:
columns = [
"title",
"repo_link_image",
"fep_type",
"implementation_count",
"tracking_issue",
"discussions",
"date_received",
]
if status == "FINAL":
columns.append("date_finalized")
elif status == "WITHDRAWN":
columns.append("date_withdrawn")
return columns
def write_overview_file(filename: str, status: str) -> None:
columns = columns_for_status(status)
feps = [x for x in index() if x.status == status]
table = "".join(
table_for_feps(feps, columns=columns, generate_title=True, format="static")
)
title = status[0] + status[1:].lower()
with open(filename, "w") as f:
f.write(markdown_frontmatter)
f.write(f"\n# {title}\n")
f.write(table)