Glossary
Available format: turns a storyStoryThe compiled model, Story: one source, which every format reads. into a
glossary: each ## heading is a term, the paragraph under it its short definition, the rest its
long one. The same file is shown as an A–Z list with its alphabet rail (« É » under « E », sorted by
Intl. in the language shown) or by section, gives each term an anchor (#lorem) and,
with pages: true, a page; the build lists under each term the pages that use it ("Used in").
The same terms are linked from any story with :term[…], see Terms.
The glossary of Récit itself is written in this format:
Glossary. The example is glossary- (English and French).
Both formats of @recit/ share one model of named entries: the
directory is the other.
A minimal glossary
glossary.md
| Written | What it is |
|---|---|
--- id=… and # heading | a section: the sections view groups the terms under it |
## heading | a term; its id is the slug of its name, or {id=…} |
| first paragraph | the short definition, one paragraph of Markdown: the card of a :term, the slide of a deck |
| the paragraphs after it | the long definition: the term's page, the speaker notes of its slide |
{aliases= | other forms the term is recognised by (plurals included, no stemming) |
{tags=a,b} | tags |
{see=id,id} | see-also links; an id that is not a term of the glossary is an error, with its line |
{source= | where the definition was taken from; license without source is an error |
Settings
In the front matter, or for every glossary of a folder in the glossary: section of
recit. (the front matter wins).
| Setting | Default | What it does |
|---|---|---|
view | az | the view shown first: az, every term under its initial with the alphabet rail, or sections, the order of the sections |
usedIn | true | lists under each term the pages that use it ("Used in"), computed at build time |
pages | false | one page per term, <slug>/<id>, prerendered and in the sitemap |
strict | false | every term writes its {id=…}; a term without one is an error |
pdf | A4 portrait | recit export --: view (az or sections, the story's own view by default), the page box |
With strict: true (front matter, or glossary: in recit.config), every term
writes its id. Each term without one is an error of recit validate and of the build, at its line:
in the glossary above, under glossary:, both ## Lorem {aliases=
(✖ glossary.) and ## Ipsum {source=
(✖ glossary.). ## Lorem {id=
and ## Ipsum {id= pass: the term keeps its anchor when its name changes. This is
not --strict of recit validate --.
One glossary per language: glossary.md and glossary. side by side, the same ids. A term
links to the glossary of the page's language first.
recit.config.ts
In an MDX page of a Récit site: <StoryEmbed slug=.
Structured data
The page that recit build writes carries the glossary's schema.org data in its head: a
DefinedTermSet in the language shown, with one DefinedTerm per term (its name, its abbreviation
and aliases as alternateName, its short definition as description). A site or another tool gets
the same document from entriesJsonLd({ format: of @recit/; with
pageUrl, an absolute address, each term gets its anchor as url.
Commands
| Command | What it does |
|---|---|
recit validate glossary.md | checks the terms, the see= ids, source and license, and strict |
recit convert glossary.md | the JSON twin, and back from glossary.json |
recit convert glossary. | a title card, then one card per term, or --per section |
recit dev glossary.md, recit build glossary.md | the glossary as a page, served while you write or built to static files |
recit export glossary. | every term, A–Z or by section, A4 portrait with its page numbers |
The PDF lands next to the story (glossary.pdf) unless -o or pdf.output names it, and is listed
in exports.json. The pdf key takes the
PDF options of every paginated format
(page, header, footer, colorMode, output…), plus view:
glossary: prints the terms under their sections. Each see
reference is a link inside the PDF.
Bridges
| Command or directive | What it gives |
|---|---|
::glossary{terms= on a slide | the short definitions of the terms named, each a link to the glossary |
MCP lookup_term | a term by id or by text, in a language: its short and long definition |
back: in a book | a page of the terms the book uses, with the pages where it uses them |
print: in a report | the same at the end of the printed report |
The JSON twin
A kind: file (https://, format:,
version: 1) next to the .md holds the same glossary under the story envelope (syntax,
preamble, meta, data, settings — see
Scenes › In the JSON twin) and scenes, while a
kind: companion (glossary.json) completes sections and terms by id.
| Key | Type / values | Effect |
|---|---|---|
scenes | object[] | Required in kind:. Sections of the glossary, in order (--- separators in Markdown; a file without --- is one section). |
scenes.id | string (non-empty) | Required. Stable section identifier across languages (--- id=… in Markdown; Scenes). |
scenes.title | string or Record<string, string> | Optional section heading (# Heading at the start of the section, shown in the sections view). |
scenes.body | string or Record<string, string> | Optional Markdown or MDX prose of the section before its first ## term (Scenes). |
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=) other than id (Scenes). |
scenes. | object[] | Optional list of terms defined in this section. |
Each object in scenes. describes one term (entries.id and entries.name are required in
kind:):
| Key | Type / values | Effect |
|---|---|---|
entries.id | string (^[a-) | Required. Stable term id across languages (anchor #id and :term{id=…} target); derived from entries.name in Markdown unless {id=…} is set (strict). |
entries.name | string or Record<string, string> | Required. Term heading (## Heading in Markdown). |
entries. | string[] (non-empty) or Record<string, string[]> | Other forms the term is recognised by ({aliases= in Markdown, plurals included, no stemming; duplicate names or aliases across terms are an error). |
entries.abbr | string (non-empty) | Abbreviation rendered as <abbr> next to the term name ({abbr=…} in Markdown). |
entries. | string (non-empty) | Code of the term in a controlled vocabulary, DefinedTerm. ({termCode=…} in Markdown). |
entries. | string or Record<string, string> | Short definition in Markdown (first paragraph under ## Heading), shown in :term hover cards, glossary lists and deck slides. |
entries.body | string or Record<string, string> | Long definition in Markdown (paragraphs after the first blank line under ## Heading), shown on the term's page and in deck speaker notes. |
entries.tags | string[] (non-empty) | Tags on the term ({tags=a,b} in Markdown). |
entries.see | string[] (non-empty) | Ids of related terms in the same glossary ({see=id,id} in Markdown; an unknown id is an error). |
entries. | { url, license? | Provenance of a definition taken from elsewhere ({source= in Markdown; license without source is an error). |
source.url | string (http: or https: URI) | Required when entries. is set. URL of the source ({source=…} in Markdown). |
source. | string (non-empty) | Optional license identifier or name ({license=…} in Markdown). |