Constructs

Every block construct of the .pres language, generated from the grammar registry (src/revealer/grammar.py) — the same table that drives the parser, the editor’s semantic edits and its side panel. For prose and examples see the authoring guide.

Quick syntax card

The cheatsheet built into the browser editor, generated from the same registry:

Slides

=== title
--- sub-slide
%%% section
>>> first:
>>> biblio

Layout

> fill
> space
> row
> col
|| columns

Text & math

* bullet
[ highlight ]
$inline$
$$display$$
@@ code

Fragments

* +
* +N
> frag

Inline format

**bold**
*italic*
`code`
[link](url)
[x]{.accent}
[x]{color}
{.title/.lede/.sm/.fine}
escape \* \` \[

Sizes & alignment

> size: 80%
> size: lede
> align:
> paragraph-spacing:

Components

> table(2,3)
> grid(2,2)
> pin
> info
> warn / good
> eq
> stack

Media

! image
!! movie

Construct index

construct

opens with

closed by

movable

table

> table(rows, cols)

> end: table

yes

grid

> grid(rows, cols) [compact]

> end: grid

yes

pin

> pin:

> end: pin

yes

row

> row

> end: row

yes

callout

> info

> end: info / > end: warn / > end: good

yes

equation

> eq

> end: eq

yes

stack

> stack

> end: stack

yes

fragment

> frag

> end: frag

yes

media

! path

nothing — a single-line construct

yes

column

> col

the next sibling marker or the parent’s > end:

no

card

> card

the next sibling marker or the parent’s > end:

no

layer

> layer

the next sibling marker or the parent’s > end:

no

table cell

> cell

the next sibling marker or the parent’s > end:

no

text column

`

`

code block

@@ [language / attributes]

a second @@ line

no

table

> table(rows, cols)

Closed by

> end: table

Sub-items

> cell (the first one is implicit — content before the first marker belongs to it)

Movable

yes — the editor can reorder, drag and delete it

Body

cells — split by the sub-item markers

CSS classes

.rv-table-wrap

Examples:

> table(2,3)

Opener pattern (the exact regex the parser and editor share):

>\s*table\(\s*\d+\s*,\s*\d+\s*\)\s*$

grid

> grid(rows, cols) [compact]

Closed by

> end: grid

Sub-items

> card (the first one is implicit — content before the first marker belongs to it)

Movable

yes — the editor can reorder, drag and delete it

Body

cells — split by the sub-item markers

CSS classes

.rv-grid-wrap

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

gap

gap

gap between cards — written on its own > gap: line inside the grid

set_grid_gap

Examples:

> grid(2,2)
> card
A
> card
B
> end: grid

Opener pattern (the exact regex the parser and editor share):

>\s*grid\(\s*\d+\s*,\s*\d+\s*\)

pin

> pin: …  [+ or +N]

Closed by

> end: pin

Movable

yes — the editor can reorder, drag and delete it

Body

regular slide content (all shortcuts available)

CSS classes

.rv-pin

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

Examples:

> pin: 50% 50% 20%

> end: pin

Opener pattern (the exact regex the parser and editor share):

>\s*pin\s*:

row

> row  [+ or +N]  [h=N]  [gap]

Closed by

> end: row

Nesting

self-nesting — a same-kind opener increases the depth

Sub-items

> col (the first one is implicit — content before the first marker belongs to it)

Movable

yes — the editor can reorder, drag and delete it

Body

regular slide content (all shortcuts available)

CSS classes

.row

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

height px

h=N

pinned height in px

set_row_height

gap

gap

gap between items (any CSS length)

set_row_gap

Examples:

> row h=400
> col

> end: row

Opener pattern (the exact regex the parser and editor share):

>\s*row\b

callout

> info  /  > warn  /  > good  [+ or +N]

Closed by

> end: info / > end: warn / > end: good (each variant closes with its own name)

Movable

yes — the editor can reorder, drag and delete it

Body

regular slide content (all shortcuts available)

CSS classes

.box-info .box-warn .box-good

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

Examples:

> info Title

> end: info
> warn Title

> end: warn

Opener pattern (the exact regex the parser and editor share):

>\s*(?:info|warn|good)\b

equation

> eq  [+ or +N]

Closed by

> end: eq

Movable

yes — the editor can reorder, drag and delete it

Body

LaTeX math (wrapped in $$ $$ when it contains no $)

CSS classes

.math-box

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

Examples:

> eq

> end: eq

Opener pattern (the exact regex the parser and editor share):

>\s*eq\b

stack

> stack  [h=N]

Closed by

> end: stack

Sub-items

> layer (the first one is implicit — content before the first marker belongs to it)

Movable

yes — the editor can reorder, drag and delete it

Body

regular slide content (all shortcuts available)

CSS classes

.rv-stack

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

height px

h=N

pinned height in px

set_stack_height

Examples:

> stack h=300
> layer

> end: stack

Opener pattern (the exact regex the parser and editor share):

>\s*stack\b

fragment

> frag

Closed by

> end: frag

Nesting

self-nesting — a same-kind opener increases the depth

Movable

yes — the editor can reorder, drag and delete it

Body

regular slide content (all shortcuts available)

CSS classes

.fragment

Examples:

> frag

> end: frag

Opener pattern (the exact regex the parser and editor share):

>\s*frag\b

media

! path  (image)   or   !! path  (video)  [+ or +N]  [h=… or w=…]  [fill | contain | cover | top | loop | autoplay | controls]  [| caption]

Closed by

nothing — a single-line construct

Movable

yes — the editor can reorder, drag and delete it

Fragment flag

accepts a trailing + / +N

Body

regular slide content (all shortcuts available)

CSS classes

.rv-fig .rv-media .rv-media-fill

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

size

h=… or w=…

fixed height / width (px, em, rem, vh, vw, %)

set_media_size

keywords

`fill

contain

cover

Examples:

! image.png fill | Caption
!! movie.mp4 loop

Opener pattern (the exact regex the parser and editor share):

!{1,2}\s+

column

> col  [+ or +N]  [size (2/5, 40%, 300px)]  [center | relative | clip]

Closed by

the next sibling marker or the parent’s > end:

Movable

no

Fragment flag

accepts a trailing + / +N

Body

regular slide content (all shortcuts available)

CSS classes

.region

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

size (2/5, 40%, 300px)

size (2/5, 40%, 300px)

size (fraction, %, length or bare flex weight)

set_col_size

keywords

`center

relative

clip`

Examples:

> col 2/5 center

Opener pattern (the exact regex the parser and editor share):

>\s*col\b

card

> card  [+ or +N]  [plain]  [: background]  [| caption]

Closed by

the next sibling marker or the parent’s > end:

Movable

no

Fragment flag

accepts a trailing + / +N

Body

regular slide content (all shortcuts available)

CSS classes

.rv-card .rv-cell

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

keywords

plain

flags: plain

Opener pattern (the exact regex the parser and editor share):

>\s*card\b

layer

> layer  [+ or +N]  [clear]

Closed by

the next sibling marker or the parent’s > end:

Movable

no

Fragment flag

accepts a trailing + / +N

Body

regular slide content (all shortcuts available)

CSS classes

.rv-layer

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

fragment #

+ or +N

reveal as a fragment (+N sets data-fragment-index)

set_fragment_index

keywords

clear

flags: clear

Opener pattern (the exact regex the parser and editor share):

>\s*layer\b

table cell

> cell  [: background]

Closed by

the next sibling marker or the parent’s > end:

Movable

no

Body

regular slide content (all shortcuts available)

CSS classes

.rv-table-cell

Opener pattern (the exact regex the parser and editor share):

>\s*cell\b

text column

||  (open / close a column block)   |  (next column)  [width]

Closed by

nothing — a single-line construct

Movable

no

Body

regular slide content (all shortcuts available)

CSS classes

.column

Parameters (whitespace-separated head tokens after the opener, unless noted):

token

accepted form

meaning

editor op

width

width

size (fraction, %, length or bare flex weight)

set_block_width

Examples:

|| 50%

| 50%

||

Opener pattern (the exact regex the parser and editor share):

\|{1,2}

code block

@@ [language / attributes]

Closed by

a second @@ line

Movable

no

Body

verbatim — content is not parsed

Examples:

@@ python

@@

Opener pattern (the exact regex the parser and editor share):

@@