Skip to content

Manifest reference

The deck DSL you use in deck.py. Everything here is imported from the top-level inkflow package:

from inkflow import Deck, Slide, Image, Video, TextBox, Align, VAlign, Inline

Refer to the Enums reference page for the shared value types used across this section. For the implemented animation and transition types, see the Animations and Transitions reference pages.

Deck dataclass

The top-level presentation container.

Define a main() -> Deck function in deck.py; inkflow calls it at serve time.

Deck → Slide inheritance:

  • transition, font_sizeoverride: a slide value replaces the deck default; None on the slide inherits.
  • style / extra_styleadditive: Deck.style is emitted first, then Slide.extra_style; the slide CSS wins on equal-specificity rules via cascade order.
  • theme, mode, embed_fonts, title — deck-only; no per-slide override.
def main() -> Deck:
    return Deck(
        transition=transitions.Crossfade(),
        theme="./my-theme",
        mode=ColorMode.DARK,
        slides=[...],
    )

slides class-attribute instance-attribute

slides: list[Slide] = field(default_factory=list)

The ordered slide list.

transition class-attribute instance-attribute

transition: Transition | None = None

Default transition for all slides. A Cut (instant) is used when unset.

theme class-attribute instance-attribute

theme: str | None = None

Path to a theme directory. None uses the built-in theme.

mode class-attribute instance-attribute

mode: ColorMode = ColorMode.DARK

Dark or light color mode for the presentation.

style class-attribute instance-attribute

style: Content = None

CSS injected into every slide. A bare str is a file path; Inline(...) is a literal CSS string.

font_size class-attribute instance-attribute

font_size: int = 36

Base font size for zone content, in px.

embed_fonts class-attribute instance-attribute

embed_fonts: bool = True

Auto-discover and embed the fonts used in slides. Set False to opt out.

title class-attribute instance-attribute

title: str | None = None

Presentation title, used for the browser tab, static build page, and PDF metadata. None infers a title from the project directory name.

Slide dataclass

A single slide.

src is a reference to an SVG file. Any SVG can define named zones, and if it does, md/zones inject content into them — whether that SVG is a one-off slide in slides/ or a reusable layout in layouts/ shared across many slides.

Markdown content can link to another slide by id with the slide: scheme ([overview](slide:overview)); clicking it jumps to that slide with a cut transition. Unresolved ids are silently ignored.

# One-off SVG with animations, no zones
Slide("title", animations=[animations.FadeIn("#headline", step=1)])

# Reusable layout with Markdown-filled zones
Slide("default", md="bullets", zones={"media": Image("photo.jpg")})

src instance-attribute

src: str

Reference to the slide's SVG file. A bare name (e.g. "default") is looked up in slides/ first, then searched across layouts (project → theme → built-in); prefix with local:, theme:, or builtin: to pin to one of those directly.

id class-attribute instance-attribute

id: str | None = None

Stable identifier, used as the slide: link target. Auto-inferred from the .md filename stem or the src stem when unset. Must be unique across the deck; collisions are resolved by appending -2, -3, …

md class-attribute instance-attribute

md: Content = None

Path to a .md file, or Inline("...") for inline Markdown. Content is routed into src's zones, if it defines any.

zones class-attribute instance-attribute

zones: dict[str, ZoneContent] = field(default_factory=dict)

Per-zone overrides. Keys are zone names without the zone- prefix; values are ZoneContent (inline Markdown str, TextBox, or Media).

animations class-attribute instance-attribute

animations: list[Animation] = field(default_factory=list)

Animation declarations for this slide.

transition class-attribute instance-attribute

transition: Transition | None = None

Transition into this slide. None inherits the deck default.

extra_style class-attribute instance-attribute

extra_style: Content = None

CSS appended to the deck style for this slide. A bare str is a file path; Inline(...) is a literal CSS string.

title class-attribute instance-attribute

title: str | None = None

Optional slide title. Auto-inferred from the filename or a leading # heading when unset.

notes class-attribute instance-attribute

notes: Content = None

Speaker notes rendered as Markdown. A bare str is a file path; Inline("...") is literal content. Concatenated with any ::notes:: marker in the Markdown file.

visible class-attribute instance-attribute

visible: bool = True

When False, the slide is excluded from the presentation entirely.

font_size class-attribute instance-attribute

font_size: int | None = None

Per-slide base font size in px. None inherits Deck.font_size.

Image dataclass

Bases: _MediaBase

An image asset for injection into a zone.

Pass it as a value in a slide's zones dict to inject it into that zone.

Slide("default", md="bullets", zones={"media": Image("photo.jpg")})

Video dataclass

Bases: _MediaBase

A video asset for injection into a zone, with playback control.

Pass it as a value in a slide's zones dict to inject it into that zone. Playback is driven by the presenter, so play_on_step ties a clip into the slide's step sequence exactly like any other stepped element.

Slide(
    "media-right",
    md="feature",
    zones={"media": Video("demo.mp4", autoplay=True, loop=True)},
)

controls class-attribute instance-attribute

controls: bool = True

Show the browser's native playback controls.

autoplay class-attribute instance-attribute

autoplay: bool = False

Start playing when the slide loads.

muted class-attribute instance-attribute

muted: Muted = Muted.AUTO

Audio muting policy. AUTO mutes only when autoplay is set, so the browser never blocks autoplay by default; ON always mutes; OFF never mutes.

loop class-attribute instance-attribute

loop: bool = False

Restart from start when the clip ends.

poster class-attribute instance-attribute

poster: str | None = None

Path/URL of a still image shown before playback begins.

start class-attribute instance-attribute

start: float | None = None

Trim-in time in seconds (temporal trim, distinct from the spatial fit/align crop).

end class-attribute instance-attribute

end: float | None = None

Trim-out time in seconds.

play_on_step class-attribute instance-attribute

play_on_step: int | None = None

Step at which the clip starts playing. Active when play_on_step <= current_step; stepping back below it resets to start. None means playback is governed by autoplay/controls alone.

TextBox dataclass

Explicit text content and alignment for a named zone in an SVG slide.

Pass it as a value in a slide's zones dict to inject HTML into that zone with alignment control. Each alignment param defaults to None, meaning "defer to the layout's CSS variable".

TextBox(text="<p>My content</p>", align=Align.CENTER, valign=VAlign.CENTER)

text class-attribute instance-attribute

text: str | None = None

HTML content to inject into the zone.

align class-attribute instance-attribute

align: Align | None = None

Horizontal text alignment. None defers to the layout CSS variable.

valign class-attribute instance-attribute

valign: VAlign | None = None

Vertical alignment of the content block. None defers to the CSS variable.

padding class-attribute instance-attribute

padding: float | None = None

Inner padding in SVG user units. None defers to the CSS variable.

Inline

Bases: str

Marks a string as literal content rather than a file path.

Fields typed as Content interpret a bare str as a file path to read. Wrapping the value in Inline(...) signals that the string itself is the content — rendered as Markdown for notes/md, or used as CSS for style/extra_style.

Inline subclasses str, so isinstance(Inline("x"), str) is True and it compares equal to its content. The distinction only matters at pipeline resolution time.

Slide("content", notes=Inline("Talk through the diagram."))
Slide("content", md=Inline("# Quick slide\n\nNo .md file needed."))
Deck(style=Inline("rect { fill: red; }"))

Content module-attribute

Content: TypeAlias = 'str | Inline | None'

A field that accepts either a file path or literal content.

A bare str is treated as a path to read; an Inline value is used verbatim. None means "nothing". Used by Slide.md, Slide.notes, Slide.extra_style, and Deck.style.

ZoneContent module-attribute

ZoneContent = str | Media | TextBox

A value accepted in Slide.zones.

A str is rendered as inline Markdown; a TextBox gives explicit alignment and padding control; an Image or Video injects media.