From cc5d4e07146da033ded55c216b41378bca9a10b4 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 15 Feb 2026 10:42:00 +0100 Subject: Add RSS generation Remove old deprecated CLI converter in __init__ --- gemini-to-web/src/gemini_to_web/indexer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gemini-to-web/src/gemini_to_web/indexer.py') 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}") -- cgit v1.2.3