OPF
SpecInternal tooling schemaView source

Layout Preview Index

Shape of previews/layouts/index.json in @openpresentation/gallery 2: one self-contained SVG preview per v2 intent layout, keyed by the matching catalog layout id. Each record names its SVG file and exact UTF-8 byte length. The gallery package owns the files; this checkout materializes ignored copies under packages/gallery/previews/layouts/. This internal index schema is excluded from the package's published/typed schema surface.

Internal preview tooling index: maps layout IDs to generated SVG preview files and exact byte lengths. Define a layout with the Slide Layout schema; this index only describes its preview assets.

This repository tooling schema is excluded from the published, typed authoring schema surface. Slide Layout defines layouts; Presentation defines your deck.

Schema $id
https://openpresentation.org/schema/opf-layout-preview-index/v1
Type
object
Source
spec/schemas/layout-preview-index.schema.json
Fields
4 · 4 required

Field index

FieldTypeReq.DefaultDescription
$schemaconstyes—
$schema · Allowed values
"https://openpresentation.org/schema/opf-layout-preview-index/v1"
versionconstyes—Index format version, as a string.
version · Allowed values
"2"
descriptionstringyes—Human-readable description of the preview gallery and its rendering conventions.
recordsarray<ref:PreviewRecord>yes—One entry per v2 layout and its SVG preview.

$schema

typeconstrequiredyesdefault—

$schema · Allowed values
"https://openpresentation.org/schema/opf-layout-preview-index/v1"
Field fragment · $schema.json
{
  "$schema": "https://openpresentation.org/schema/opf-layout-preview-index/v1"
}

version

typeconstrequiredyesdefault—

Index format version, as a string.

version · Allowed values
"2"
Field fragment · version.json
{
  "version": "2"
}

description

typestringrequiredyesdefault—

Human-readable description of the preview gallery and its rendering conventions.

records

typearray<ref:PreviewRecord>requiredyesdefault—

One entry per v2 layout and its SVG preview.

Complete definition constraints
Exact schema constraints
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openpresentation.org/schema/opf-layout-preview-index/v1",
  "title": "Layout Preview Index",
  "description": "Shape of previews/layouts/index.json in @openpresentation/gallery 2: one self-contained SVG preview per v2 intent layout, keyed by the matching catalog layout id. Each record names its SVG file and exact UTF-8 byte length. The gallery package owns the files; this checkout materializes ignored copies under packages/gallery/previews/layouts/. This internal index schema is excluded from the package's published/typed schema surface.",
  "type": "object",
  "required": [
    "$schema",
    "version",
    "description",
    "records"
  ],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://openpresentation.org/schema/opf-layout-preview-index/v1"
    },
    "version": {
      "type": "string",
      "description": "Index format version, as a string.",
      "examples": [
        "2"
      ],
      "const": "2"
    },
    "description": {
      "type": "string",
      "description": "Human-readable description of the preview gallery and its rendering conventions."
    },
    "records": {
      "type": "array",
      "description": "One entry per v2 layout and its SVG preview.",
      "items": {
        "$ref": "#/$defs/PreviewRecord"
      }
    }
  },
  "$defs": {
    "PreviewRecord": {
      "type": "object",
      "description": "One layout template preview.",
      "required": [
        "id",
        "file",
        "bytes"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "The matching layout record id, such as cover, chart or two-column.",
          "pattern": "^[a-z][a-z0-9-]*$"
        },
        "file": {
          "type": "string",
          "description": "SVG filename, relative to this index directory, using the matching layout id.",
          "pattern": "^[a-z][a-z0-9-]*\\.svg$"
        },
        "bytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Exact UTF-8 byte length of the referenced SVG file."
        }
      }
    }
  }
}