Skip to content

Commit ac4afba

Browse files
committed
modified: .github/actions/recent-posts/main.py
- Dumped rich.table because it doesn't format nicely in markdown.
1 parent 075635e commit ac4afba

File tree

1 file changed

+2
-14
lines changed
  • .github/actions/recent-posts

1 file changed

+2
-14
lines changed

.github/actions/recent-posts/main.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from pydantic_xml.model import (
1010
attr, BaseXmlModel, computed_element, element, wrapped
1111
)
12-
from rich.console import Console
13-
from rich.table import Table
1412
from typer import Typer
1513
from typer.params import Argument
1614

@@ -58,19 +56,9 @@ def main(
5856
text = f.read()
5957

6058
pattern = r"(?<=<!-- BLOG START -->)[\S\s]*(?=<!-- BLOG END -->)"
61-
table = Table(*("Title", "Author", "Published"))
62-
table.add_row(
63-
*(
64-
f"[{model.entry.title}]({model.entry.link})",
65-
model.entry.author,
66-
model.entry.published.strftime("%Y-%m-%d %I:%M%p"),
67-
)
59+
repl = (
60+
f"- [{model.entry.title}]({model.entry.link}) by {model.entry.author}"
6861
)
69-
console = Console()
70-
with console.capture() as capture:
71-
console.print(table)
72-
73-
repl = capture.get()
7462
new_text = re.sub(pattern=pattern, repl=f"\n{repl}\n", string=text)
7563
with readme.open(mode="w") as f:
7664
f.write(new_text)

0 commit comments

Comments
 (0)