How uphy/obsidian-reminder works
Project Overview
• Type & Purpose: This project is an Obsidian plugin that adds reminder functionality to markdown TODOs. It extends Obsidian’s core behavior by parsing reminders in task items (with formats like “@YYYY-MM-DD” and others) and providing UI components, notifications, and interoperability with other plugins (e.g., Tasks, Kanban).
• Key Features: Setting reminders, listing them, delivering notifications, and interoperability with related plugin formats.
Main Components
• Plugin Core / Entry Point:
– Highlight the main file (src/main.ts) which serves as the plugin’s initialization point.
• Model Layer:
– “src/model” houses the data definitions and reminder/format logic. Include nodes representing:
• Content models (content.ts)
• Parsing and formatting modules (the markdown formatter, reminder-base, reminder-default, reminder-kanban-plugin, reminder-tasks-plugin, splitter, etc.)
• Time-related utilities (time.ts) and refinement logic (reminder.ts, ref.ts)
• Plugin Logic:
• Commands: (found under src/plugin/commands – e.g., convert-reminder-time-format, scan-reminders, show-date-chooser, etc.) which handle user-triggered actions.
• Data and Filesystem Abstraction: (src/plugin/data.ts and filesystem.ts) that interface with the underlying file system where Obsidian stores markdown notes.
• Notification Worker: (src/plugin/notification-worker.ts) which manages background notification tasks.
• Obsidian Integration Layer: (src/plugin/obsidian-hack) which might tweak or extend Obsidian’s behavior, including event handling and possibly UI hooks.
• Plugin Settings and Helper Modules: (src/plugin/settings and associated helpers) that manage configuration.
• User Interface (UI):
– “src/ui” contains Svelte components that render on-screen elements such as the Calendar, DateTimeChooser, Reminder lists, and individual Reminder components.
– Additionally, “src/plugin/ui” holds helper UI functionalities and modals (for autocomplete, date chooser modals, datetime-format modal, etc.).
• Documentation and Developer Support:
– The “docs” directory holds the guides, which indirectly explain how users interact with the plugin but are also useful for understanding how components relate (e.g., how reminders are set, modified, and listed).
Relationships & Flow
• Initialization: From the main entry point (src/main.ts), the plugin loads its various modules (model, plugin logic, UI components) and registers command handlers with Obsidian’s API.
• Data Flow:
– User actions via UI components (in Svelte) trigger commands (in src/plugin/commands).
– Those commands use model functions to parse and format task reminders.
– Via the filesystem abstraction, the plugin scans and updates markdown files.
– A notification worker asynchronously monitors reminder times and triggers Obsidian notifications.
• Integration:
– The “obsidian-hack” directory shows integration points where Obsidian’s internal behaviors might be modified or extended (such as custom commands or debugging hooks).
Architectural Patterns & Design Principles
• Modularization: Each concern (data modeling, command handling, UI rendering, etc.) is isolated in its respective module/sub-directory.
• Separation of Concerns: UI components are separated from business logic and data format processing.
• Extensibility: The use of plugin-specific directories like obsidian-hack and the existence of various command modules indicate a design that favors extensibility and future integration with other tools/plugins.