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 |
|---|---|---|---|
|
|
yes |
|
|
|
yes |
|
|
|
yes |
|
|
|
yes |
|
|
|
yes |
|
|
|
yes |
|
|
|
yes |
|
|
|
yes |
|
|
nothing — a single-line construct |
yes |
|
|
the next sibling marker or the parent’s |
no |
|
|
the next sibling marker or the parent’s |
no |
|
|
the next sibling marker or the parent’s |
no |
|
|
the next sibling marker or the parent’s |
no |
|
` |
` |
||
|
a second |
no |
table¶
> table(rows, cols)
Closed by |
|
Sub-items |
|
Movable |
yes — the editor can reorder, drag and delete it |
Body |
cells — split by the sub-item markers |
CSS classes |
|
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 |
|
Sub-items |
|
Movable |
yes — the editor can reorder, drag and delete it |
Body |
cells — split by the sub-item markers |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
gap between cards — written on its own |
|
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 |
|
Movable |
yes — the editor can reorder, drag and delete it |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
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 |
|
Nesting |
self-nesting — a same-kind opener increases the depth |
Sub-items |
|
Movable |
yes — the editor can reorder, drag and delete it |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
|
|
pinned height in px |
|
|
|
gap between items (any CSS length) |
|
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 |
|
Movable |
yes — the editor can reorder, drag and delete it |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
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 |
|
Movable |
yes — the editor can reorder, drag and delete it |
Body |
LaTeX math (wrapped in |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
Examples:
> eq
> end: eq
Opener pattern (the exact regex the parser and editor share):
>\s*eq\b
stack¶
> stack [h=N]
Closed by |
|
Sub-items |
|
Movable |
yes — the editor can reorder, drag and delete it |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
pinned height in px |
|
Examples:
> stack h=300
> layer
> end: stack
Opener pattern (the exact regex the parser and editor share):
>\s*stack\b
fragment¶
> frag
Closed by |
|
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 |
|
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 |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
|
|
fixed height / width (px, em, rem, vh, vw, %) |
|
|
`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 |
Movable |
no |
Fragment flag |
accepts a trailing |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
|
|
size (fraction, %, length or bare flex weight) |
|
|
`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 |
Movable |
no |
Fragment flag |
accepts a trailing |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
|
|
flags: |
— |
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 |
Movable |
no |
Fragment flag |
accepts a trailing |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
reveal as a fragment ( |
|
|
|
flags: |
— |
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 |
Movable |
no |
Body |
regular slide content (all shortcuts available) |
CSS classes |
|
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 |
|
Parameters (whitespace-separated head tokens after the opener, unless noted):
token |
accepted form |
meaning |
editor op |
|---|---|---|---|
|
|
size (fraction, %, length or bare flex weight) |
|
Examples:
|| 50%
| 50%
||
Opener pattern (the exact regex the parser and editor share):
\|{1,2}
code block¶
@@ [language / attributes]
Closed by |
a second |
Movable |
no |
Body |
verbatim — content is not parsed |
Examples:
@@ python
@@
Opener pattern (the exact regex the parser and editor share):
@@