Docs/OPF Spec
Open Source · MIT

OPF — Open Presentation Format

OPF is an open-source JSON format for describing presentations. It separates content intent from rendering complexity, letting AI agents produce slide decks without wrestling with OOXML.

Document Structure

An OPF document has four required top-level fields:

{
  "$schema": "https://pptx.dev/schema/opf/v1",
  "version": "1.0",
  "meta": { ... },      // Title, audience, narrative, tags
  "design": { ... },    // Colors, fonts, dimensions, brand
  "slides": [ ... ],    // Ordered array of slides
  "presenterGuide": "", // Optional global notes
  "extensions": {}      // Optional custom data
}
metarequired

High-level presentation metadata. Only `title` is required. Everything else helps the AI engine make better design choices.

title*
stringPresentation title
filename
stringOptional base name for downloads (no extension). The engine strips one trailing .pptx, .pdf, .png, or .svg (case-insensitive), normalizes whitespace, then appends the export format. Invalid values fail validation.
subtitle
stringOptional subtitle
author
stringAuthor name
company
stringCompany or organization
audience
stringWho this is for: "Board of Directors", "Engineering team"
purpose
stringWhy this presentation exists
narrative
NarrativeStorytelling structure and tone
language
stringISO language code (default: en)
tags
string[]Searchable tags
meta.narrative

Control the storytelling approach. Reference a named template or describe freely.

template
stringNamed template: "problem-solution", "situation-complication-resolution", "hero-journey"
description
stringFree-form narrative for AI-driven generation
keyMessages
string[]Key takeaways the audience should remember
tone
enum"formal" | "casual" | "inspirational" | "technical" | "persuasive"
durationMinutes
numberTarget presentation duration
designrequired

Visual design system. Reference named schemes from pptx.gallery or define custom values.

theme
stringNamed theme: "corporate-minimal", "dark-tech", "bold-startup"
colors
ColorSchemeColor palette with named scheme or individual overrides
fonts
FontSchemeTypography with named scheme or individual overrides
dimensions
DimensionsSlide size: "16:9", "4:3", or custom inches
background
BackgroundDefault background: solid, gradient, image, or pattern
brand
BrandLogo, watermark, and company name
layoutPreferences
LayoutPreferencesDensity, alignment, animations, slide numbers

Slides

Each slide has an ID, a layout reference, and an array of elements:

{
  "id": "revenue-slide",
  "layout": "content-with-chart",
  "section": "Financial Overview",
  "elements": [
    {
      "id": "title",
      "type": "text",
      "slot": "title",
      "content": { "text": "Revenue Growth" }
    },
    {
      "id": "chart",
      "type": "chart",
      "slot": "main",
      "chartType": "bar",
      "data": {
        "labels": ["Q1", "Q2", "Q3", "Q4"],
        "datasets": [{
          "label": "Revenue ($M)",
          "values": [12, 19, 24, 31],
          "color": "#22c55e"
        }]
      }
    }
  ],
  "notes": "Revenue grew 34% YoY driven by enterprise expansion.",
  "transition": { "type": "fade", "duration": 0.5 }
}

Element Types

text

Rich text with formatting runs, markdown, or bullet lists

image

Images with fit, border radius, shadow, and caption

chart

Bar, line, pie, donut, area, scatter, radar, waterfall, funnel, treemap, combo

table

Tabular data with headers, styled rows, and formatting

shape

Rectangles, circles, arrows, lines, stars, callouts, custom SVG paths

code

Code blocks with syntax highlighting and line numbers

video

Embedded video with poster frame and autoplay

group

Nested container for grouping multiple elements

placeholder

AI instruction — describes what to generate

Three Ways to Provide Design Choices

1. Reference pptx.gallery

Use named schemes from the curated gallery at pptx.gallery. Browse themes, color schemes, font pairings, layouts, and narrative templates.

"colors": { "scheme": "ocean-depth" }

2. Custom JSON with validation

Define every color, font, and layout inline. Use the JSON Schema at https://pptx.dev/schema/opf/v1 for IDE autocomplete and CI validation.

"colors": { "primary": "#1a1a2e", "accent": "#e94560" }

3. AI-generated from natural language

In the Studio, describe what you want in plain language. The AI agent constructs the OPF JSON from your intent, referencing gallery options when appropriate.

"Clean, modern, dark theme for a tech startup pitch"

Markdown DSL

OPF has a Markdown alias designed for humans and LLMs. It is a format, not a new schema: every Markdown document parses to the same JSON, and every OPF JSON document serializes to Markdown. JSON is the canonical form; the Markdown DSL is for editing comfort.

Document metadata lives in YAML frontmatter. Each slide is an h2 heading with an optional attribute block. Element IDs, slots, and layout hints go in {key=value} attribute blocks — the same idea as Pandoc.

---
$schema: https://pptx.dev/schema/opf/v1
version: "1.0"
meta:
  title: Board QBR
design:
  theme: corporate-minimal
---

## Revenue Growth {id=revenue, layout=content-with-chart, section=Financials}

{id=title, slot=title}

Revenue Growth

{id=summary, slot=body}

We grew 34% YoY driven by enterprise expansion.

- Enterprise ARR up 42%
- Net retention at 128%

Sugar and escape hatches

Common elements have sugar: headings and paragraphs become text, GFM tables become table, ![alt](src) becomes image, and fenced code blocks become code. Anything the sugar cannot express round-trips losslessly through an escape-hatch fence:

```opf-element
id: chart
type: chart
chartType: bar
data:
  labels: [Q1, Q2, Q3, Q4]
  datasets:
    - label: Revenue ($M)
      values: [12, 19, 24, 31]
      color: "#22c55e"
```

Charts, shapes, videos, groups, and placeholders always use the escape hatch. Text elements with explicit styling and anything else sugar cannot represent also fall back automatically. The playground toggle lets you flip between JSON, YAML, and Markdown on the same document.

JSON Schema

The full JSON Schema is published at https://pptx.dev/schema/opf/v1. Use it for editor autocomplete, CI validation, or building custom tooling.