(category: str, title: str, used: set[str])
| 452 | |
| 453 | |
| 454 | def entry_id(category: str, title: str, used: set[str]) -> str: |
| 455 | base = f"{category}-{slugify(title, max_len=50)}" |
| 456 | candidate = base |
| 457 | n = 1 |
| 458 | while candidate in used: |
| 459 | n += 1 |
| 460 | candidate = f"{base}-{n}" |
| 461 | used.add(candidate) |
| 462 | return candidate |
| 463 | |
| 464 | |
| 465 | def write_categories(sections: list[Section]) -> None: |
no test coverage detected