diff --git a/main.py b/main.py index 8ff3723..1066468 100644 --- a/main.py +++ b/main.py @@ -15,8 +15,15 @@ def collect_daily_notes(): try: all_files = os.listdir(daily_notes_path) md_files = [f for f in all_files if os.path.isfile(os.path.join(daily_notes_path, f)) and f.endswith('.md')] - logging.debug(f"Found .md files: {md_files}") - return md_files + + # Sort in reverse alphabetical order + md_files.sort(reverse=True) + + # Transform to the desired format + formatted_notes = [f"![[{f[:-3]}]]" for f in md_files] + + logging.debug(f"Formatted notes: {formatted_notes}") + return formatted_notes except OSError as e: logging.error(f"Error accessing directory {daily_notes_path}: {e}") return []