Calendar
Available format: turns a story into a calendar:
one event per scene, written in the wall time of its zone. The same file is shown as a
month, a week, an agenda and a year, filtered by tag and read in the reader's own zone on request;
each event has its own page, and the calendar is exported to a feed that any calendar app
subscribes to (.ics) and to a PDF.
The examples are calendar- (JSON, two languages) and calendar- (Markdown, two
languages, recurrences across the changes of time); calendar.recit.dev shows both, and the releases
of Récit. Times, zones and the changes of time have their own page:
Time zones and changes of time.
A minimal calendar
meetups.md
Bash
| Attribute | What it is |
|---|---|
start | a wall time, YYYY-, in the event's timezone, else the calendar's |
end or duration | one or the other, never both. duration: 1h, 90m, 1h30m or ISO 8601 (PT1H30M) |
date | an all-day event; with end (a date), over several days, end included |
timezone | an IANA zone (America/); not on a date event |
rrule, exdate | an RFC 5545 rule without its RRULE: prefix; the dates it skips, comma-separated, written like start |
location | free text, @id of an entry of the places directory, or a place in JSON ({"name":) |
url, tags | a link (a video call, tickets), tags the views filter on |
status | confirmed (default), tentative, cancelled: a cancelled event stays, struck through, STATUS: |
deck, film | a linked story: "See the deck", "See the film" |
register | the sign-up form: its anchor (#form-signup for :::form{#), a path or an address; "Register" opens it with ?recit-, sent as meta.about |
color | a lightness of the site's hue, soft, base or strong, never a free color |
| the heading and body | the first heading is the event's title, the rest its description, in full Markdown |
The attributes fit on the separator line. A long one is written in JSON instead
(--- {"id":).
Settings
In the front matter, or for every calendar of a folder in the calendar: section of
recit. (the front matter wins).
| Setting | Default | What it does |
|---|---|---|
timezone | none | the zone of the wall times; required once an event has a time |
view | month | the view shown first: month, week, agenda or year |
firstDay | the language's | monday, sunday or saturday |
window | { past: | the occurrences computed around the build day, past and future as ISO durations |
maxOccurrences | 500 | the most occurrences computed per event |
noOverlap | false | two overlapping occurrences are an error |
url | none | where the calendars are published (https://): the host of the UIDs |
places | none | the directory story that resolves location=@id, relative to the calendar's folder |
pdf | A4 portrait, a month | recit export --: view (month or agenda), from, months, the page box |
include: lists the roadmaps whose milestones join the calendar; it belongs to the story, so it is
written in the front matter only (Bridges). The pdf key takes the
PDF options of every paginated format
(page, toc, header, footer, colorMode, output…), plus view, from and months.
recit.config.ts
The JSON twin
A calendar is the same story in Markdown and in JSON (kind:, checked by
https://), converted both ways by recit convert. In JSON, a
title, a description and a place's name hold one value per language; the times, the rules and the
places do not change from one language to the other.
meetups.json
In Markdown, the French variant is a file beside the first, course.fr.md beside course.md, with
the same ids, times and rules.
Alongside scenes.id and scenes.body (see
Scenes › In the JSON twin) and the schedule,
scenes.title, scenes.tags and scenes. (location.name, location.city,
location.geo, or a free-text / @id string) fields shown above, each event in scenes accepts
these keys:
| Key | Type / values | Effect |
|---|---|---|
scenes. | boolean | Implied by scenes.date; setting allDay: true together with scenes.start is an error (calendar-). |
scenes.url | string (URI) | Event link (such as a video call or ticket office), exported as URL in .ics and used as the online URL in JSON-LD when unplaced. |
scenes. | "confirmed" | "tentative" | "cancelled" | Event status ("confirmed" when omitted; "cancelled" keeps the event struck through and writes STATUS: in .ics). |
scenes.deck | string (non-empty) | Link to a related deck ("See the deck" on the event detail and event page). |
scenes.film | string (non-empty) | Link to a related film ("See the film" on the event detail and event page). |
scenes. | string (non-empty) | The sign-up form: its anchor (#form-signup for :::form{#), a path or an address; « Register » opens it with ?recit-. |
scenes.color | "soft" | "base" | "strong" | Lightness variant of the site's hue on the event card ("base" when omitted), never an arbitrary CSS color. |
scenes.notes | string or Record<string, string> | Optional author notes in Markdown (:::notes; Scenes). |
scenes.attrs | Record<string, string | number | boolean> | Optional separator attributes (--- key=) not covered by a typed event field (Scenes). |
location. | string | Free-text display address on an inline scenes. place, shown as written and never parsed into structured postal fields. |
location. | string | Street address on an inline scenes. place. |
location. | string | Postal code on an inline scenes. place. |
location. | string | Region, state or administrative area on an inline scenes. place. |
location. | string (^[A-Z]{2}$) | ISO 3166-1 alpha-2 country code (such as "FR") on an inline scenes. place. |
Commands
| Command | What it does |
|---|---|
recit dev meetups.md | the calendar with live reload |
recit build meetups. | the four views and a page per event, prerendered in the calendar's zone (-o, --output, ./dist) |
recit validate meetups.md | the story against its schema and the rules below |
recit convert meetups. | the JSON twin; --to md goes back to Markdown (--locale fr picks the language) |
recit convert agenda. | imports an iCalendar file; what Récit does not read (ATTENDEE, VALARM, X-…) is listed as warnings |
recit export meetups. | the feed: one VEVENT per event, RRULE and EXDATE kept, a VTIMEZONE per zone, stable UIDs |
recit export meetups. | a page per month, or the agenda, A4 portrait (--color- or dark) |
-o, --output names the file (a folder for build); without it the export is written beside the
story, meetups.ics or meetups.pdf, and listed in exports.json (--no- leaves the
manifest alone). --locale fr exports one language of a bilingual calendar. Every command and its
flags are in the CLI reference.
The feed
The feed carries REFRESH- and X-WR-CALNAME for the apps that subscribe to it; the
"Subscribe" button of a page offers webcal://, Google Calendar, Outlook and the file itself, with
no third-party script. A site build writes /calendar/ (and /fr/)
and one /calendar/ per event, all listed in exports.json. Serve .ics files as
text/.
The rules
recit validate reports each one with its file and line, or its JSON path
(meetups.).
| Code | Severity | When |
|---|---|---|
calendar- | error | neither start nor date, or both; end and duration together |
calendar- | error | end before start (or before date) |
calendar- | error | a zone Intl does not know |
calendar- | error | an event with a time in a calendar without timezone |
calendar- | error | a rule that does not parse, UNTIL and COUNT together |
calendar- | error | two occurrences overlap, only with noOverlap: |
calendar- | warning | a wall time that does not exist (spring forward) |
calendar- | warning | a wall time that exists twice (fall back) |
calendar- | warning | an exdate that matches no occurrence |
calendar- | warning | the expansion stopped at maxOccurrences |
Bridges
| From → to | How |
|---|---|
| roadmap → calendar | include: in the front matter |
| calendar → webstory | recit convert meetups. |
| calendar → atlas | recit convert meetups. |
All three are owned by their target, the exception written on the Bridges page.
From a roadmap: include:
include: lists roadmaps (paths relative to the calendar, never a URL): their dated milestones
become all-day events, tagged milestone, in the language of the page; with the roadmap's
ics:, its dated items too. Their ids are prefixed with the roadmap's slug
(product.v1), and an undated milestone does not cross.
course.md
A calendar can be made of include: only, with an empty body: calendar.recit.dev shows the releases
of Récit this way, from the roadmap of Récit.
To a webstory and to an atlas
recit convert meetups. tells the next occurrences as an "upcoming" story: a title
card, then one card per occurrence with its title, its date in the calendar's zone and language, its
place and a link to its page. recit convert meetups. puts the events whose place has
a geo on a map, an overview then one view per event ahead; an address is never geocoded. Both
compile the calendar as recit build does, write Markdown by default (-o story.json for the twin)
and refuse a calendar with nothing to show, with nothing written.
Places from a directory
places: names a directory story: location=@ then takes the name, the
address and the geo of that entry, the same place on every event and in the JSON-LD.
In a site
A site publishes a calendar like any story (publish:), at /<routePrefix>/, and a page
per event at /<routePrefix>/: its dates, its place, its description, its deck or
film, "Subscribe" for that event alone, and its schema. JSON-LD for search engines. In an
MDX page:
MDX
UpcomingEvents counts from the reader's clock once the page is loaded, so a site built on Monday
does not show Monday's event as upcoming on Tuesday.
On the fullscreen pages of a site (publish.), the calendar's and each event's, a
"Back to the site" link above the title leads to the site's home in the calendar's language; an
event page keeps its own "Back to the calendar" under it. An embedded calendar has none.
A calendar opens on the month of the build day when that month has an event. Otherwise it opens on
the month of the next event, or, for a calendar that only holds past events (releases, a finished
season), on the month of the last one: it never opens on an empty month. ?date= in the address,
and the date of the Calendar component, still choose the date shown first; "Today" goes back to
the build day.
Packages
TypeScript
| Import | Contents |
|---|---|
@recit/ | storyToCalendar, expandEvents, calendarIcs, roadmapCalendarEvents, the model |
@recit/ | the views (Calendar, MonthView, AgendaList, EventCard…) and calendarStrings |
@recit/ | mountCalendar, the page of recit dev and recit build |
@recit/ | the stylesheet of the views |
@recit/ | includedRoadmaps, calendarPlaces: the joins with a roadmap and a directory (Node) |
@recit/time | the wall times, zones and recurrences the calendar and the roadmap share |
@recit/ | the calendar model (Calendar, CalendarEvent, Occurrence), re-exported by @recit/ |
Joins in Node
@recit/ holds the two joins of a calendar, includedRoadmaps (the dated milestones
of the roadmaps of include:) and calendarPlaces (the places of its places directory). The
calendar depends on neither format: the caller reads them. A roadmap reader, with public names only
(the one of recit build is not exported):
TypeScript
calendarPlaces(file, places, { loadStory, directoryPlaces }) takes loadStory of @recit/cli and
directoryPlaces of @recit/. The reader is tested as written.
MCP
describe_ explains the format, validate_ checks a calendar, and expand_ gives
the occurrences of a story in a window and a zone, so that an agent checks a rule before it writes
it. The guide is recit://.