Documentation
¶
Index ¶
Constants ¶
const ( CapabilityRead = "read" CapabilityWrite = "write" CapabilityPlan = "plan" CapabilityApply = "apply" CapabilityCreate = "create" CapabilityTransitions = "transitions" CapabilityAudio = "audio" CapabilitySections = "sections" )
Standard capability strings.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct {
Source AudioSource `json:"source"`
Path string `json:"path,omitempty"` // Local file path
URL string `json:"url,omitempty"` // Remote URL
Script string `json:"script,omitempty"` // Text for TTS generation
Duration time.Duration `json:"duration,omitempty"` // Explicit or computed duration
Voice string `json:"voice,omitempty"` // TTS voice ID
}
Audio represents audio attachment for LMS/video generation.
func NewFileAudio ¶
NewFileAudio creates an audio reference from a local file.
func NewNotesAudio ¶
NewNotesAudio creates an audio reference for TTS generation from speaker notes.
func NewTTSAudio ¶
NewTTSAudio creates an audio reference for TTS generation from a script.
func NewURLAudio ¶
NewURLAudio creates an audio reference from a remote URL.
func (*Audio) HasContent ¶
HasContent returns true if the audio has a valid source reference.
type AudioSource ¶
type AudioSource string
AudioSource identifies audio origin.
const ( AudioSourceFile AudioSource = "file" // Pre-recorded audio file AudioSourceURL AudioSource = "url" // Remote audio URL AudioSourceTTS AudioSource = "tts" // Generate via TTS from script AudioSourceNotes AudioSource = "notes" // Generate via TTS from speaker notes )
func AudioSources ¶
func AudioSources() []AudioSource
AudioSources returns all valid audio source values.
func (AudioSource) IsValid ¶
func (s AudioSource) IsValid() bool
IsValid returns true if the audio source is a recognized value.
func (AudioSource) NeedsTTS ¶
func (s AudioSource) NeedsTTS() bool
NeedsTTS returns true if this audio source requires TTS generation.
type Backend ¶
type Backend interface {
// Info returns backend metadata.
Info() BackendInfo
// Read loads a presentation from the backend.
Read(ctx context.Context, ref Ref) (*Deck, error)
// Plan computes changes needed to reach desired state.
Plan(ctx context.Context, ref Ref, desired *Deck) (*Diff, error)
// Apply executes a diff against the backend.
Apply(ctx context.Context, ref Ref, diff *Diff) error
// Create creates a new presentation.
Create(ctx context.Context, deck *Deck) (Ref, error)
}
Backend defines the interface for presentation backends.
type BackendInfo ¶
type BackendInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Capabilities []string `json:"capabilities"`
}
BackendInfo describes backend capabilities.
func (BackendInfo) HasCapability ¶
func (b BackendInfo) HasCapability(cap string) bool
HasCapability returns true if the backend has the specified capability.
type Block ¶
type Block struct {
Kind BlockKind `json:"kind"`
Text string `json:"text,omitempty"`
Level int `json:"level,omitempty"` // Bullet nesting level (0 = top level)
Lang string `json:"lang,omitempty"` // Code language
URL string `json:"url,omitempty"` // Image/link URL
Alt string `json:"alt,omitempty"` // Image alt text
}
Block represents content within a slide.
func NewNumbered ¶
NewNumbered creates a numbered list item block.
type Change ¶
type Change struct {
Op ChangeOp `json:"op"`
Path string `json:"path"` // e.g., "sections/0/slides/2/title"
SlideID string `json:"slide_id,omitempty"` // Target slide ID
SectionID string `json:"section_id,omitempty"` // Target section ID
OldValue any `json:"old_value,omitempty"`
NewValue any `json:"new_value,omitempty"`
}
Change represents a single modification.
func NewAddChange ¶
NewAddChange creates an add operation.
func NewMoveChange ¶
NewMoveChange creates a move operation.
func NewRemoveChange ¶
NewRemoveChange creates a remove operation.
func NewUpdateChange ¶
NewUpdateChange creates an update operation.
type Deck ¶
type Deck struct {
ID string `json:"id"`
Title string `json:"title"`
Meta Meta `json:"meta"`
Sections []Section `json:"sections"`
Theme *Theme `json:"theme,omitempty"`
}
Deck represents a complete presentation.
func (*Deck) FindSection ¶
FindSection finds a section by ID.
func (*Deck) SlideCount ¶
SlideCount returns the total number of slides across all sections.
func (*Deck) TotalDuration ¶
TotalDuration returns the total audio duration of the deck.
type Diff ¶
Diff represents changes between two deck states.
func (*Diff) AddChanges ¶
AddChanges returns only add operations.
func (*Diff) ChangeCount ¶
ChangeCount returns the number of changes.
func (*Diff) MoveChanges ¶
MoveChanges returns only move operations.
func (*Diff) RemoveChanges ¶
RemoveChanges returns only remove operations.
func (*Diff) UpdateChanges ¶
UpdateChanges returns only update operations.
type Layout ¶
type Layout string
Layout identifies slide layout type.
const ( LayoutTitle Layout = "title" // Title slide LayoutTitleBody Layout = "title_body" // Title + body content LayoutTitleTwoCol Layout = "title_two_col" // Title + two columns LayoutSection Layout = "section" // Section divider LayoutBlank Layout = "blank" // No predefined structure LayoutImage Layout = "image" // Full-bleed image LayoutComparison Layout = "comparison" // Side-by-side comparison )
type Meta ¶
type Meta struct {
Author string `json:"author,omitempty"`
Date string `json:"date,omitempty"`
Description string `json:"description,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Custom map[string]string `json:"custom,omitempty"`
}
Meta contains presentation metadata.
type Ref ¶
type Ref struct {
Backend string `json:"backend"` // "marp", "gslides", "reveal"
ID string `json:"id"` // Backend-specific identifier
Path string `json:"path"` // File path (for file-based backends)
}
Ref identifies a presentation in a backend.
type Section ¶
type Section struct {
ID string `json:"id"`
Title string `json:"title"`
Slides []Slide `json:"slides"`
Audio *Audio `json:"audio,omitempty"` // Section-level audio for LMS
}
Section groups related slides (maps to LMS sections/chapters).
func (*Section) HasAudio ¶
HasAudio returns true if the section has audio (either section-level or slide-level).
func (*Section) SlideCount ¶
SlideCount returns the number of slides in this section.
func (*Section) TotalDuration ¶
TotalDuration returns the total audio duration of the section. If section-level audio is set, returns its duration. Otherwise, sums slide-level audio durations.
type Slide ¶
type Slide struct {
ID string `json:"id"`
Layout Layout `json:"layout"`
Title string `json:"title,omitempty"`
Subtitle string `json:"subtitle,omitempty"`
Body []Block `json:"body,omitempty"`
Notes []Block `json:"notes,omitempty"` // Speaker notes
Audio *Audio `json:"audio,omitempty"` // Slide-level audio
Transition *string `json:"transition,omitempty"` // Reveal.js transitions
Background *string `json:"background,omitempty"`
}
Slide represents a single slide.
func (*Slide) BulletCount ¶
BulletCount returns the number of bullet points in the body.
type Theme ¶
type Theme struct {
Name string `json:"name,omitempty"`
Primary string `json:"primary,omitempty"` // Primary color (hex)
Secondary string `json:"secondary,omitempty"` // Secondary color (hex)
Background string `json:"background,omitempty"` // Background color (hex)
Font string `json:"font,omitempty"` // Font family
Custom map[string]string `json:"custom,omitempty"` // Backend-specific settings
}
Theme represents presentation styling.