add function to convert filename to title

This commit is contained in:
Daniel Fichtinger 2025-06-21 16:41:14 -04:00
parent 0b4de161b5
commit 71982435f3
2 changed files with 16 additions and 0 deletions

9
tests/test_util.py Normal file
View file

@ -0,0 +1,9 @@
from pathlib import Path
from zona import util
def test_title(tmp_path: Path):
a = tmp_path / "my-first-post.md"
b = tmp_path / "Writing_emails_Post.md"
assert util.filename_to_title(a) == "My First Post"
assert util.filename_to_title(b) == "Writing Emails Post"