places
Event
Event information with date, location, and agenda
Install
- Add the package:
npm install @refrakt-md/places - Add it to the
pluginsarray inrefrakt.config.json:"plugins": ["@refrakt-md/places"]
Source
import Markdoc from '@markdoc/markdoc';
import type { RenderableTreeNode } from '@markdoc/markdoc';
const { Tag } = Markdoc;
import {
createContentModelSchema,
createComponentRenderable,
asNodes,
renderNodes,
RenderableNodeCursor,
pageSectionProperties,
unwrapParagraphImages,
fieldMetas,
} from '@refrakt-md/runes';
export const eventSections = { headline: 'title', blurb: 'description', body: 'body' } as const;
export const eventSchema = {
type: 'Event',
properties: {
headline: 'name',
blurb: 'description',
date: 'startDate',
endDate: 'endDate',
url: 'url',
},
entities: {
location: { type: 'Place', property: 'location', properties: { location: 'name' } },
},
} as const;
export const event = createContentModelSchema({
schema: eventSchema,
sections: eventSections,
provides: ['prose'],
attributes: {
date: {
type: String,
required: false,
description: 'Start date of the event (e.g. 2025-06-15).',
},
endDate: { type: String, required: false, description: 'End date for multi-day events.' },
location: {
type: String,
required: false,
description: 'Venue or place name where the event is held.',
},
url: { type: String, required: false, description: 'Link to the event page or ticket source.' },
},
contentModel: {
type: 'sequence',
fields: [
{ name: 'header', match: 'heading|paragraph|image', greedy: true },
{ name: 'body', match: 'list|blockquote|tag', greedy: true },
],
},
transform(resolved, attrs, config) {
const header = new RenderableNodeCursor(
unwrapParagraphImages(
Markdoc.transform(asNodes(resolved.header), config) as RenderableTreeNode[],
),
);
const body = renderNodes(resolved.body, config);
const sectionProps = pageSectionProperties(header);
const bodyDiv = body.wrap('div');
const resultChildren: any[] = [...header.toArray(), bodyDiv.next()];
return createComponentRenderable({
rune: 'event',
tag: 'article',
properties: fieldMetas(attrs, config, {
date: '',
endDate: '',
location: '',
url: '',
}),
refs: {
...sectionProps,
body: bodyDiv,
},
children: resultChildren,
});
},
});
A single event, such as a conference, meetup or workshop, with its dates, place and registration link, published as structured data.
Basic usage
An event with date, location, agenda, and a registration link.
{% event date="2025-06-15" endDate="2025-06-17" location="San Francisco, CA" url="https://example.com/register" %}
# Tech Conference 2025
Join us for three days of talks, workshops, and networking with the web development community.
- Keynote: The Future of Web Development
- Workshop: Building with Semantic Content
- Panel: Open Source Sustainability
- Networking Dinner
{% /event %}<article data-rune="event" data-rune-fields="{"date":"2025-06-15","endDate":"2025-06-17","location":"San Francisco, CA","url":"https://example.com/register"}" typeof="Event">
<h1 id="tech-conference-2025" data-name="headline" property="name">Tech Conference 2025</h1>
<p data-name="blurb" property="description">Join us for three days of talks, workshops, and networking with the web development community.</p>
<div data-name="body">
<ul>
<li>Keynote: The Future of Web Development</li>
<li>Workshop: Building with Semantic Content</li>
<li>Panel: Open Source Sustainability</li>
<li>Networking Dinner</li>
</ul>
</div>
<meta property="startDate" content="2025-06-15">
<meta property="endDate" content="2025-06-17">
<meta property="url" content="https://example.com/register">
<span typeof="Place" property="location">
<meta property="name" content="San Francisco, CA">
</span>
</article>Tech Conference 2025
Join us for three days of talks, workshops, and networking with the web development community.
- Keynote: The Future of Web Development
- Workshop: Building with Semantic Content
- Panel: Open Source Sustainability
- Networking Dinner
<article class="rf-event rf-event--2025-06-15 rf-event--2025-06-17 rf-event--San Francisco, CA rf-event--https://example.com/register" typeof="Event" data-date="2025-06-15" data-end-date="2025-06-17" data-location="San Francisco, CA" data-url="https://example.com/register" data-elevation="flat" data-rune="event" data-density="full">
<header data-name="preamble" class="rf-event__preamble">
<h1 id="tech-conference-2025" data-name="headline" property="name" class="rf-event__headline" data-section="title">Tech Conference 2025</h1>
<p data-name="blurb" property="description" class="rf-event__blurb" data-section="description">Join us for three days of talks, workshops, and networking with the web development community.</p>
</header>
<dl data-name="metadata" data-zone="metadata" data-zone-layout="definition-list" class="rf-event__metadata">
<div data-name="row" data-field="date" class="rf-event__row">
<dt data-meta-label="">Date</dt>
<dd>
<span data-meta-type="temporal">2025-06-15</span>
</dd>
</div>
<div data-name="row" data-field="endDate" class="rf-event__row">
<dt data-meta-label="">Ends</dt>
<dd>
<span data-meta-type="temporal">2025-06-17</span>
</dd>
</div>
<div data-name="row" data-field="location" class="rf-event__row">
<dt data-meta-label="">Location</dt>
<dd>
<span data-meta-type="category">San Francisco, CA</span>
</dd>
</div>
</dl>
<div data-name="body" class="rf-event__body" data-section="body">
<ul>
<li>Keynote: The Future of Web Development</li>
<li>Workshop: Building with Semantic Content</li>
<li>Panel: Open Source Sustainability</li>
<li>Networking Dinner</li>
</ul>
</div>
<meta property="startDate" content="2025-06-15" />
<meta property="endDate" content="2025-06-17" />
<meta property="url" content="https://example.com/register" />
<span typeof="Place" property="location">
<meta property="name" content="San Francisco, CA" />
</span>
</article>How Markdown is read
| You write | It becomes |
|---|---|
| A heading | The event's name |
| The paragraph after it | Its description |
| A list or blockquote | The event's details, such as the agenda or the speakers |
Attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
date | string | — | Start date of the event (e.g. 2025-06-15). |
endDate | string | — | End date for multi-day events. |
location | string | — | Venue or place name where the event is held. |
url | string | — | Link to the event page or ticket source. |
Universal attributes
bg
The background layer: image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.
| Attribute | Type | Required | Description |
|---|---|---|---|
bg | string | — | Background preset applied to this block |
bg-from | string | — | Gradient start colour — a semantic token name (→ var(--rf-color-*)) |
bg-gradient | "to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl" | — | Gradient direction (bounded named set) |
bg-gradient-type | "linear" | "radial" | "conic" | — | Gradient type |
bg-to | string | — | Gradient end colour — a semantic token name |
bg-via | string | — | Optional middle gradient stop — a semantic token name |
scrim | "top" | "bottom" | "left" | "right" | "none" | — | Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim |
scrim-blur | "none" | "sm" | "md" | "lg" | — | Frost scrim blur amount |
scrim-strength | "sm" | "md" | "lg" | — | Gradient scrim strength |
scrim-tone | "dark" | "light" | — | Whether the scrim darkens (for light text) or lightens (for dark text) |
scrim-type | "gradient" | "frost" | — | Scrim treatment: gradient (default) or frost (backdrop blur) |
dropcap
Per-instance drop-cap opt-in.
| Attribute | Type | Required | Description |
|---|---|---|---|
dropcap | boolean | — | Style the opening letter of a prose body as a drop cap. Honoured only when the body reads as prose; ignored otherwise. |
elevation
How far the rune sits off the page, from sunken to overlay. The theme decides what each step looks like.
| Attribute | Type | Required | Description |
|---|---|---|---|
elevation | "sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg" | — | Surface depth, from sunken to overlay. Deprecated: none, sm, md and lg (read as flat, raised, raised and floating) |
inset
Internal padding override.
| Attribute | Type | Required | Description |
|---|---|---|---|
inset | "flush" | "tight" | "default" | "loose" | "breathe" | — | Inner padding of this block |
motion
Scroll-reveal entrance. You choose its character; the theme decides how it moves.
| Attribute | Type | Required | Description |
|---|---|---|---|
reveal | "none" | "fade" | "slide" | "scale" | "blur" | — | Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography |
stagger | boolean | — | Cascade this block's items in as it reveals (no-op on single-child runes) |
prominence
Header emphasis. Scales a rune's header, or its featured quotation; the theme decides the type size for each step.
| Attribute | Type | Required | Description |
|---|---|---|---|
prominence | "quiet" | "normal" | "prominent" | "display" | "marquee" | — | Emphasis of a page-section header or a featured quotation (only on runes that have one) |
reading
Editorial register for body text. You pick the register; the theme decides how it looks.
| Attribute | Type | Required | Description |
|---|---|---|---|
reading | "fine" | "ui" | "prose" | — | Reading register for this block’s body: fine | ui | prose. The theme sets how each one looks. |
spacing
Block-level rhythm override.
| Attribute | Type | Required | Description |
|---|---|---|---|
spacing | "flush" | "tight" | "default" | "loose" | "breathe" | — | Vertical spacing above and below this block |
substrate
Generated pattern fills behind the content, drawn by the theme.
| Attribute | Type | Required | Description |
|---|---|---|---|
substrate | "dots" | "grid" | "lines" | "cross" | "checker" | "none" | — | Generated surface pattern |
substrate-fill | "inherit" | "inset" | — | Surface fill the pattern sits on (full colour stays with tint) |
substrate-opacity | "sm" | "md" | "lg" | — | Pattern ink strength |
substrate-size | "sm" | "md" | "lg" | — | Pattern cell size |
substrate-target | "self" | "media" | — | Which surface the pattern fills (overrides the rune/theme default) |
tint
Per-rune colour override: a named tint from the theme registry, with inline per-token overrides layered on top.
| Attribute | Type | Required | Description |
|---|---|---|---|
tint | string | — | Color tint preset applied to this block |
tint-mode | "auto" | "dark" | "light" | — | Whether the tint adapts to auto, dark, or light mode |
width
The track a block rune occupies.
| Attribute | Type | Required | Description |
|---|---|---|---|
width | "compact" | "narrow" | "content" | "wide" | "full" | — | Maximum width constraint for this block |
| Not available | Why |
|---|---|
| frame | this rune declares neither a `frameTarget` nor a media section |