mirror of
https://codeberg.org/fediverse/fep.git
synced 2026-08-05 03:35:52 +00:00
f68a69fc79
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>
42 lines
948 B
Python
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)
|