Skip to content

Glossary

Available format: glossary 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.Collator 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-lorem (English and French). Both formats of @recit/directory share one model of named entries: the directory is the other.

A minimal glossary

Markdownglossary.md
--- title: Lorem Glossary format: glossary lang: en view: az # az | sections pages: false # one page per term --- --- id=basics # Basics ## Lorem {aliases=lorems tags=core see=ipsum} A placeholder text. One paragraph: the short definition, shown in the card of a :term. The long definition follows, as many paragraphs as needed. ## Ipsum {source=https://example.com/ipsum license=CC-BY-4.0} The second word of the placeholder.
WrittenWhat it is
--- id=… and # headinga section: the sections view groups the terms under it
## headinga term; its id is the slug of its name, or {id=…}
first paragraphthe short definition, one paragraph of Markdown: the card of a :term, the slide of a deck
the paragraphs after itthe long definition: the term's page, the speaker notes of its slide
{aliases=a,b}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=… license=…}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.config.ts (the front matter wins).

SettingDefaultWhat it does
viewazthe view shown first: az, every term under its initial with the alphabet rail, or sections, the order of the sections
usedIntruelists under each term the pages that use it ("Used in"), computed at build time
pagesfalseone page per term, <slug>/<id>, prerendered and in the sitemap
strictfalseevery term writes its {id=…}; a term without one is an error
pdfA4 portraitrecit export --to pdf: view (az or sections, the story's own view by default), the page box

With strict: true (front matter, or glossary: { strict: true } 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: { strict: true }, both ## Lorem {aliases=… see=ipsum} (✖ glossary.md:13 — entry "Lorem" has no id (strict)) and ## Ipsum {source=…} (✖ glossary.md:19 — entry "Ipsum" has no id (strict)). ## Lorem {id=lorem aliases=… see=ipsum} and ## Ipsum {id=ipsum source=…} pass: the term keeps its anchor when its name changes. This is not --strict of recit validate --links.

One glossary per language: glossary.md and glossary.fr.md side by side, the same ids. A term links to the glossary of the page's language first.

TypeScriptrecit.config.ts
import { defineConfig } from "recit/config"; export default defineConfig({ glossary: { view: "sections", usedIn: true, pages: true, strict: true }, });

In an MDX page of a Récit site: <StoryEmbed slug="glossary" format="glossary" />.

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: "glossary", glossary }) of @recit/directory; with pageUrl, an absolute address, each term gets its anchor as url.

Commands

CommandWhat it does
recit validate glossary.mdchecks the terms, the see= ids, source and license, and strict
recit convert glossary.mdthe JSON twin, and back from glossary.json
recit convert glossary.md --to webstorya title card, then one card per term, or --per section
recit dev glossary.md, recit build glossary.mdthe glossary as a page, served while you write or built to static files
recit export glossary.md --to pdf -o glossary.pdfevery 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: { pdf: { view: "sections" } } prints the terms under their sections. Each see reference is a link inside the PDF.

Bridges

Command or directiveWhat it gives
::glossary{terms=lorem,ipsum} on a slidethe short definitions of the terms named, each a link to the glossary
MCP lookup_terma term by id or by text, in a language: its short and long definition
back: [glossary] in a booka page of the terms the book uses, with the pages where it uses them
print: { glossary: true } in a reportthe same at the end of the printed report

The JSON twin

A kind: "story" file (https://recit.dev/schema/v1/glossary.json, format: "glossary", 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: "sidecar" companion (glossary.json) completes sections and terms by id.

KeyType / valuesEffect
scenesobject[]Required in kind: "story". Sections of the glossary, in order (--- separators in Markdown; a file without --- is one section).
scenes.idstring (non-empty)Required. Stable section identifier across languages (--- id=… in Markdown; Scenes).
scenes.titlestring or Record<string, string>Optional section heading (# Heading at the start of the section, shown in the sections view).
scenes.bodystring or Record<string, string>Optional Markdown or MDX prose of the section before its first ## term (Scenes).
scenes.notesstring or Record<string, string>Optional author notes in Markdown (:::notes; Scenes).
scenes.attrsRecord<string, string | number | boolean>Optional separator attributes (--- key=value) other than id (Scenes).
scenes.entriesobject[]Optional list of terms defined in this section.

Each object in scenes.entries describes one term (entries.id and entries.name are required in kind: "story"):

KeyType / valuesEffect
entries.idstring (^[a-z0-9][\w-]*$)Required. Stable term id across languages (anchor #id and :term{id=…} target); derived from entries.name in Markdown unless {id=…} is set (strict).
entries.namestring or Record<string, string>Required. Term heading (## Heading in Markdown).
entries.aliasesstring[] (non-empty) or Record<string, string[]>Other forms the term is recognised by ({aliases=a,b} in Markdown, plurals included, no stemming; duplicate names or aliases across terms are an error).
entries.abbrstring (non-empty)Abbreviation rendered as <abbr> next to the term name ({abbr=…} in Markdown).
entries.termCodestring (non-empty)Code of the term in a controlled vocabulary, DefinedTerm.termCode ({termCode=…} in Markdown).
entries.summarystring or Record<string, string>Short definition in Markdown (first paragraph under ## Heading), shown in :term hover cards, glossary lists and deck slides.
entries.bodystring 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.tagsstring[] (non-empty)Tags on the term ({tags=a,b} in Markdown).
entries.seestring[] (non-empty)Ids of related terms in the same glossary ({see=id,id} in Markdown; an unknown id is an error).
entries.source{ url, license? }Provenance of a definition taken from elsewhere ({source=… license=…} in Markdown; license without source is an error).
source.urlstring (http: or https: URI)Required when entries.source is set. URL of the source ({source=…} in Markdown).
source.licensestring (non-empty)Optional license identifier or name ({license=…} in Markdown).