Commit Graph

31 Commits

Author SHA1 Message Date
ddad50803c fix: use deterministic hash for SCHED/WARN function names
Replaces the global sequential counter (sched_1, warn_2, …) with a
polynomial hash of (UUID ^ date), so names are stable across runs and
unique across calendars — eliminating "function redefined" errors when
multiple .rem files are included by Remind.
2026-06-19 23:33:24 +02:00
7388be79da fix: use %b %3 instead of %1 in timed alarm MSG
%b %3 shows both day offset and verbose time remaining, giving more
context when the reminder fires the day before the event.
2026-06-19 23:16:33 +02:00
a260443fba fix: collect all fields in override reminders 2026-06-02 18:32:58 +02:00
af76d08c52 docs/feat: add stdin support via - filename 2026-05-24 18:49:30 +02:00
c55c9f9af4 fix: add backtrace recording and output on errors 2026-05-24 18:35:19 +02:00
37e72e41fb docs: fix yearly recurrence format and clarify sort/limitations
- Fix `REM Mon DD` → `REM MMM DD` in yearly recurrence table
- Clarify `--sort original` preserves processing order in CLI reference
- Update `RELATED=END` trigger behaviour (treated as `RELATED=START`)
- Remove unsupported EXDATE/RDATE+override limitation (now handled)
- Fix `--sort none` → `--sort original` in CLI help text
- Remove EXDATE/RDATE/override guard from `simple_recurrence`
2026-05-24 18:15:38 +02:00
69384dcfc2 feat(cli): add output control flags, sort order, and verbose mode
- Add `--verbose`/`-v` flag; gate all diagnostic stderr output behind it
- Add `--no-uuid`, `--no-source`, `--no-location`, `--no-description`,
  `--no-conference-url` flags to suppress individual INFO lines
- Add `--sort` option (`asc`, `desc`, `original`) replacing hardcoded
  descending sort
- Add `--source` option to override calendar name (single-file only)
- Introduce `Config` module with global `ref` flags set at startup from
  CLI args
- Add `Utils.warn` helper that writes to stderr only when
  `Config.verbose` is set
- Normalise all diagnostic messages to a consistent format (`Warning:
  ... (UID: ...)`)
- Remove `debug_print_of_recurrence_and_skip`; inline skip at each call
  site
- Fix `add_common_part` to always emit a trailing `\\\n    `
  continuation line
2026-05-24 12:25:22 +02:00
510f178630 refactor: rename project from remind_sync to ical2rem
- Rename executable public_name and package name from remind_sync to
  ical2rem
- Update dune-project with new name, source URI, maintainer, synopsis,
  description, and tags
- Add dune-build-info dependency and use Build_info to generate the
  version string at build time instead of the %%VERSION%% placeholder
- Add pinned dependencies to ical2rem.opam
- Remove remind_sync.opam
- Bump dune lang version from 3.20 to 3.23
2026-05-24 00:03:48 +02:00
122a65f3e0 feat(remind): implement alarm rendering for triggers
Remove debug logging from `collect_triggers` and
`separate_master_and_recurrence`, and add full alarm rendering support:
convert `Timedesc.Span.t` triggers to `++n`/`WARN`/`+n`/`SCHED` remind
syntax for both all-day and timed events, with dynamic `FSET` generation
for multiple triggers and annotated `MSG` bodies showing advance notice.
2026-05-23 19:20:22 +02:00
062196dcfd docs(eventPredicates): remove case analysis predicate comments 2026-05-23 17:55:33 +02:00
1329dfd1f7 feat(alarms): collect VALARM trigger offsets from iCalendar events
- Add `triggers` field to `Remind.rem` type to store alarm trigger
  offsets as `Timedesc.Span.t list`
- Implement `get_triggers` in `Utils` to extract duration-based triggers
  from audio/display alarms, ignoring email and NONE alarms
- Add `collect_triggers` collector that populates the triggers field and
  logs them to stderr for debugging
- Register `collect_triggers` in the collector pipeline
- Remove leftover debug log for processed filenames in `main.ml`
- Remove stale commented-out RRULE dataset and type documentation from
  `simple_recurrence`
2026-05-23 17:54:38 +02:00
8748a39b13 docs: mark P15/P16 as unsupported and P17 as done; store original iCal event in rem 2026-05-20 16:17:24 +02:00
dc11e077bf feat(timezone): add Windows timezone name resolution
Add a `Windows_tz` module containing a CLDR-sourced mapping table from
Windows timezone names to canonical IANA names. Update
`timedesc_of_timestamp` to resolve Windows-style timezone identifiers
(e.g. `"W. Europe Standard Time"`) via this table before constructing a
`Timedesc.Time_zone.t`, falling back to the local timezone with a
warning if resolution fails entirely.
2026-05-19 23:56:54 +02:00
d961a9f32a feat: add conference URL support for virtual meetings 2026-05-19 23:19:00 +02:00
527669227b feat: add --timezone CLI option for configurable output timezone 2026-05-18 14:51:05 +02:00
37ecfd6130 feat: add location and description fields to reminders 2026-05-18 14:36:54 +02:00
2c4191ef13 fix: use event TZID for UNTIL date conversion
Add a `tz` field to `rem` to carry the event's DTSTART timezone, and
introduce `timedesc_of_utc_or_timestamp_tz` to convert UNTIL timestamps
in that timezone instead of the process locale. This makes UNTIL
comparisons locale-independent for events with a known TZID.
2026-05-18 00:17:04 +02:00
eda3be195a feat(monthly): add support for MONTHLY recurrence (P07, P08)
- Add `monthly_pattern`, `simple_monthly` types and `monthly` field to
  `rem`
- Implement `render_monthly` and `add_until_monthly` in `remind.ml`
- Handle `BYMONTHDAY` (P07) and nth-weekday `BYDAY` (P08) patterns in
  `eventPredicates.ml`
- Add `add_months` utility for date arithmetic
- Mark P07 and P08 as implemented in documentation
2026-05-17 23:51:54 +02:00
106aff01bf feat(recurring): implement RECURRENCE-ID override handling
- Add `overrides` field to `rem` type to hold single-event REMs from
  non-cancelled overrides
- Add `is_cancelled`, `build_override_rem`, and `collect_overrides` to
  process RECURRENCE-ID override events
- Replace `warn_unhandled_recurring` with `collect_overrides` in the
  collector pipeline
- Fix `separate_master_and_recurrence` partition logic (swapped
  `Left`/`Right`)
- Render override REMs appended to the master REM in `string_of_rem`
2026-05-17 20:04:18 +02:00
a5e15fa84f feat(event-predicates): warn on unhandled recurrence overrides and multiple masters
- Add `warn_unhandled_recurring` collector that emits a warning when
  `RECURRENCE-ID` overrides are present but not yet handled, emitting
  the master event as-is
- Register `warn_unhandled_recurring` in `all_collectors`
- Warn when more than one master event (no `RECURRENCE-ID`) is found for
  a UID in `separate_master_and_recurrence`, using only the first
2026-05-17 19:19:51 +02:00
a1f31042e0 feat(remind): escape special characters in MSG clause body 2026-05-17 13:25:19 +02:00
e9f4773312 feat: support EXDATE, DATE+DURATION, and weekly day inference
- Handle DATE+DURATION all-day events by computing end_date from
  duration
- Add PUSH/POP-OMIT-CONTEXT and OMIT/SKIP support for EXDATE in
  daily/weekly rendering
- Adjust UNTIL date when local time of UNTIL timestamp precedes event
  start time
- Default weekly RRULE to event's own weekday when BYDAY list is empty
- Remove EXDATE check from complex-recurrence guard (handled via OMIT
  now)
- Add timedesc_wd_to_ical weekday conversion utility
- Remove verbose EXDATE debug logging
- Fix minor newline in file processing log message
2026-05-17 12:58:08 +02:00
0bd014c1fe fix: sort reminders by date in descending order before output 2026-05-17 00:43:25 +02:00
5a584a8440 feat(remind): add calendar source to rendered reminders 2026-05-17 00:33:02 +02:00
794c855cec feat(recurrence): add daily recurrence support
- Add `simple_daily` type and `daily` field to `rem`
- Implement `render_daily`, `add_interval_daily`, and `add_until_daily`
- Extend `simple_recurrence` collector to handle `FREQ=DAILY` alongside
  `FREQ=WEEKLY`
- Remove dead `expand_recurrence` collector
- Mark P06 pattern as implemented ()
2026-05-17 00:25:01 +02:00
8777bd3932 refactor(remind): extract buffer primitives for remind rendering 2026-05-16 22:24:06 +02:00
4e6ba30f2d feat: add source file tracking to rem type
Add a `source` field to `Remind.rem` to track the originating iCalendar
filename (basename without extension). Thread the basename through
`remind_of_event` so each reminder records which file it came from.
2026-05-16 22:14:27 +02:00
9445eb81e8 refactor: remove remind_sync wrapper library and inline utilities
The `remind_sync` library was acting as a thin re-export layer. This
commit removes it entirely and moves the only non-trivial utility
(`show_error` for `Timedesc.Date.Ymd.error`) directly into
`bin/utils.ml`. Dead `[@@deriving show]` annotations on `rem`,
`week_first_day`, and `error` types are also removed.
2026-05-16 22:06:54 +02:00
21215a2248 feat: implement simple weekly recurrence rendering
- Add `simple_weekly` type and `weekly` field to `rem` record
- Add `exdate` field to `rem` for excluded dates
- Add `collect_exdates` collector to pipeline
- implement weekly `RRULE` handling with `BYDAY`, `INTERVAL`,
  `COUNT`/`UNTIL`
- Add `render_weekly` to emit one `REM` per weekday with `UNTIL`/`*N`
- Replace `timedesc_of_date_or_datetime` with
  `timedesc_of_utc_or_timestamp_local` in utils
- Refactor `get_exdates`/`get_rdates` to separate dates, datetimes and
  periods; add debug logging per UID
- Wrap reminder output in try/catch in main; drop trailing newline
  duplication
- Mark implemented predicates (P00–P05, P09, P12, P14) with ;
  remove P18–P20 (ignored/deferred)
2026-05-16 21:56:14 +02:00
0b9de82c3a feat: support multiple input files
- Accept multiple positional arguments instead of a single required file
- Extract `read_file` helper to separate file reading from parsing
- Collect all valid reminders across files before printing
- Handle per-file errors gracefully without aborting the whole run
2026-05-15 23:12:51 +02:00
cace23d3f1 Initial commit 2025-09-01 00:00:00 +02:00