diff options
| author | alex <alex@pdp7.net> | 2026-02-15 10:42:00 +0100 |
|---|---|---|
| committer | alex <alex@pdp7.net> | 2026-02-15 10:42:00 +0100 |
| commit | cc5d4e07146da033ded55c216b41378bca9a10b4 (patch) | |
| tree | 0fb4e8dff5d64a9c47d02706716e4377a81a6d04 /gemini-to-web/src/gemini_to_web/indexer.py | |
| parent | 144273180f8b4fdcc3356bbe72c7bdc799f2c6eb (diff) | |
Add RSS generation
Remove old deprecated CLI converter in __init__
Diffstat (limited to 'gemini-to-web/src/gemini_to_web/indexer.py')
| -rw-r--r-- | gemini-to-web/src/gemini_to_web/indexer.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gemini-to-web/src/gemini_to_web/indexer.py b/gemini-to-web/src/gemini_to_web/indexer.py index 3d463e3..a6ceee0 100644 --- a/gemini-to-web/src/gemini_to_web/indexer.py +++ b/gemini-to-web/src/gemini_to_web/indexer.py @@ -1,15 +1,12 @@ import argparse import pathlib -import re import sys +import gemini_to_web from gemini_to_web import parser from gemini_to_web import html -ENTRY_ELEMENT_TITLE = re.compile(r"^(\d{4}-\d{2}-\d{2}) (.*)$") - - def cli_indexer(): argument_parser = argparse.ArgumentParser() argument_parser.add_argument("base_path", type=pathlib.Path) @@ -25,9 +22,10 @@ def cli_indexer(): parsed = parser.parse(path.read_text()) parsed = list(parsed) first_header_title = html.first_header_title_extractor(parsed) - match = ENTRY_ELEMENT_TITLE.match(first_header_title) + match = gemini_to_web.ENTRY_ELEMENT_TITLE.match(first_header_title) if match: posts.append((match.group(1), path.relative_to(args.base_path), match.group(2))) posts = sorted(posts, reverse=True) for date, path, title in posts: + path = str(path).removesuffix(".gmi") print(f"=> {path} {date} {title}") |
