mirror of
https://github.com/vinta/awesome-python.git
synced 2026-08-27 04:07:39 +00:00
refactor(build): accept Path directly in build() signature
Remove internal str->Path conversion; callers and tests now pass Path objects directly. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b9236c4925
commit
c85f81bb24
2 changed files with 9 additions and 10 deletions
|
|
@ -133,11 +133,10 @@ def format_stars_short(stars: int) -> str:
|
|||
return str(stars)
|
||||
|
||||
|
||||
def build(repo_root: str) -> None:
|
||||
def build(repo_root: Path) -> None:
|
||||
"""Main build: parse README, render single-page HTML via Jinja2 templates."""
|
||||
repo = Path(repo_root)
|
||||
website = repo / "website"
|
||||
readme_text = (repo / "README.md").read_text(encoding="utf-8")
|
||||
website = repo_root / "website"
|
||||
readme_text = (repo_root / "README.md").read_text(encoding="utf-8")
|
||||
|
||||
subtitle = ""
|
||||
for line in readme_text.split("\n"):
|
||||
|
|
@ -208,4 +207,4 @@ def build(repo_root: str) -> None:
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
build(str(Path(__file__).parent.parent))
|
||||
build(Path(__file__).parent.parent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue