INNER CODE UNIT · Python
github_anchor
gokayfem/awesome-vlm-architectures · scripts/build_release_timeline.py:438
def github_anchor(heading: str) -> str:
"""Mirror GitHub's heading anchors for the characters used in this catalog."""
cleaned = "".join(
character
for character in heading.lower()
if character.isalnum() or character in {" ", "-", "_"}
)
return cleaned.replace(" ", "-")
def models_block(sections: list[dict[str, object]]) -> str:
years: dict[str, list[str]] = {}
for section in sections:
year = release_date(section)[:4]
label = str(section["label"])
anchor = github_anchor(str(section["heading"]))
years.setdefault(year, []).append(f"[{label}](#{anchor})")
lines = [