diff --git a/.gitignore b/.gitignore index 79dd134..62d713d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +dist/ assets/jsconfig.json dist/ diff --git a/website/entrypoints.py b/website/entrypoints.py index 870d7af..ef01445 100644 --- a/website/entrypoints.py +++ b/website/entrypoints.py @@ -3,41 +3,38 @@ from website.posts import concatenate_drafts, create_new_post from website.task_helpers import check_project_root -app = typer.Typer(add_completion=False) - - -@app.command() -def new_post(title: str, series=None, quarto=False): - """ - Create a new post with a given title under a specified category. - Optionally, specify a series name. - Params: - "title": "The title of the blog post you want to create." - "series": "The series to which the blog post belongs (optional)." - "quarto": "Initialize a quarto_document, defaults to False" - """ +app = typer.Typer( + add_completion=False, help="Utility helpers for working on my website." +) + + +@app.command(help="Create a new (series) post with a given title.") +def new_post( + title: str = typer.Option(help="The title of the blog."), + series: str + | None = typer.Option( + help="The series the blog post entry belongs to.", default=None + ), + quarto: bool = typer.Option( + help="Initialize a quarto_document instead of regular markdown", default=False + ), +): check_project_root() create_new_post(title, series, quarto) -@app.command() +@app.command(help="Concatenate all draft posts into a single markdown file.") def list_draft_posts( - file_out="current_draft_posts.md", - search_directory="content/post", - search_string="draft: true", + file_out: str = typer.Option( + help="The output file name for concatenated drafts.", + default="current_draft_posts.md", + ), ): - """ - Concatenate all draft posts into a single markdown file. - Params - "file_out": "The output file name for concatenated drafts. Defaults to 'concatenated_drafts.md'." - "search_directory": "The directory to search for draft posts. Defaults to 'content/post'." - "search_string": "The string to search for in the markdown files to identify drafts. Defaults to 'draft: true'." - """ check_project_root() concatenate_drafts( file_out=file_out, - search_directory=search_directory, - search_string=search_string, + search_directory="content/post", + search_string="draft: true", )