link title to proposal

This commit is contained in:
Olaf
2026-09-18 13:13:52 +02:00
parent 1cdc6a3031
commit ce6e1bf017
82 changed files with 94 additions and 82 deletions
+4 -1
View File
@@ -8,12 +8,15 @@ from pathlib import Path
CAMEL_CASE_RE = re.compile(r'(?<=[a-z])(?=[A-Z])')
MARKDOWN_LINK_RE = re.compile(r'^\[(.*?)\]\([^)]*\)$')
def read_title(markdown_path: Path) -> str:
for line in markdown_path.read_text(encoding='utf-8').splitlines():
if line.startswith('# '):
return line[2:].strip()
title = line[2:].strip()
link_match = MARKDOWN_LINK_RE.match(title)
return link_match.group(1) if link_match else title
return markdown_path.stem