Skip to content

Commit 92583bc

Browse files
authored
Merge pull request #5 from roumail/develop
Develop
2 parents 4ec626b + c7d2409 commit 92583bc

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist/
12
assets/jsconfig.json
23

34
dist/

website/entrypoints.py

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,38 @@
33
from website.posts import concatenate_drafts, create_new_post
44
from website.task_helpers import check_project_root
55

6-
app = typer.Typer(add_completion=False)
7-
8-
9-
@app.command()
10-
def new_post(title: str, series=None, quarto=False):
11-
"""
12-
Create a new post with a given title under a specified category.
13-
Optionally, specify a series name.
14-
Params:
15-
"title": "The title of the blog post you want to create."
16-
"series": "The series to which the blog post belongs (optional)."
17-
"quarto": "Initialize a quarto_document, defaults to False"
18-
"""
6+
app = typer.Typer(
7+
add_completion=False, help="Utility helpers for working on my website."
8+
)
9+
10+
11+
@app.command(help="Create a new (series) post with a given title.")
12+
def new_post(
13+
title: str = typer.Option(help="The title of the blog."),
14+
series: str
15+
| None = typer.Option(
16+
help="The series the blog post entry belongs to.", default=None
17+
),
18+
quarto: bool = typer.Option(
19+
help="Initialize a quarto_document instead of regular markdown", default=False
20+
),
21+
):
1922
check_project_root()
2023
create_new_post(title, series, quarto)
2124

2225

23-
@app.command()
26+
@app.command(help="Concatenate all draft posts into a single markdown file.")
2427
def list_draft_posts(
25-
file_out="current_draft_posts.md",
26-
search_directory="content/post",
27-
search_string="draft: true",
28+
file_out: str = typer.Option(
29+
help="The output file name for concatenated drafts.",
30+
default="current_draft_posts.md",
31+
),
2832
):
29-
"""
30-
Concatenate all draft posts into a single markdown file.
31-
Params
32-
"file_out": "The output file name for concatenated drafts. Defaults to 'concatenated_drafts.md'."
33-
"search_directory": "The directory to search for draft posts. Defaults to 'content/post'."
34-
"search_string": "The string to search for in the markdown files to identify drafts. Defaults to 'draft: true'."
35-
"""
3633
check_project_root()
3734
concatenate_drafts(
3835
file_out=file_out,
39-
search_directory=search_directory,
40-
search_string=search_string,
36+
search_directory="content/post",
37+
search_string="draft: true",
4138
)
4239

4340

0 commit comments

Comments
 (0)