Skip to content

Terms

:term[story]{id=story} links a word to its definition in a glossary: a real link to the term's anchor, and a card with its short definition on hover and on keyboard focus (Escape closes it). Without JavaScript the link still leads to the glossary. Like this: storyStoryThe compiled model, Story: one source, which every format reads..

MarkdownMarkdown
A :term[sidecar]{id=sidecar} completes the scenes of a story by their id. A :term[scene] without an id is looked up by its name and aliases. :term[lorem]{off} is never linked.

An id (or a label) that no glossary defines is an error, with its line. Only the short definitions of the terms used in a page are embedded in it.

Where the terms come from

TypeScriptrecit.config.ts
export default defineConfig({ terms: { sources: ["./stories/glossary.md"], // glossary.<lang>.md is read first autolink: "none", // none (default) | first | all }, });

A story overrides the section in its front matter (terms: { autolink: first }).

Automatic linking

With autolink: first, the first time a term (or one of its aliases) appears in a scene it is linked, the longest alias first, on word boundaries and without case; all links every time. Code, headings, links, MDX and speaker notes are never touched, and an explicit :term counts as the first. Only the terms written in the page's language are linked automatically.

The Term component

Term (in @recit/components, @recit/components/terms) is what :term renders: in a deck, in a Récit site and in @recit/site-stories. On a slide, ::glossary{terms=lorem,ipsum} shows the short definitions of several terms at once.