source

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package source provides interfaces and implementations for loading content from various sources (Marp markdown, transcript JSON, config YAML).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigSource

type ConfigSource struct {
	// contains filtered or unexported fields
}

ConfigSource loads content from a unified config file (YAML/JSON). It supports mixed slide and browser segments.

func NewConfigSource

func NewConfigSource(cfg *config.VideoConfig) *ConfigSource

NewConfigSource creates a source from a config

func NewConfigSourceFromFile

func NewConfigSourceFromFile(path string) (*ConfigSource, error)

NewConfigSourceFromFile loads a config from a YAML/JSON file

func (*ConfigSource) GetConfig

func (s *ConfigSource) GetConfig() *config.VideoConfig

GetConfig returns the underlying config

func (*ConfigSource) GetFilePath

func (s *ConfigSource) GetFilePath() string

GetFilePath returns the source file path

func (*ConfigSource) GetMetadata

func (s *ConfigSource) GetMetadata() Metadata

GetMetadata returns presentation-level metadata

func (*ConfigSource) Load

func (s *ConfigSource) Load() ([]segment.Segment, error)

Load parses the config and returns segments

type ContentSource

type ContentSource interface {
	// Load parses the source and returns segments
	Load() ([]segment.Segment, error)

	// GetMetadata returns presentation-level metadata
	GetMetadata() Metadata
}

ContentSource represents a source of content that can be loaded into segments.

type Metadata

type Metadata struct {
	// Title is the presentation title
	Title string

	// Description is an optional description
	Description string

	// DefaultLanguage is the BCP-47 language code
	DefaultLanguage string

	// DefaultVoice is the default TTS voice configuration
	DefaultVoice transcript.VoiceConfig

	// Languages is the list of languages available
	Languages []string

	// Tags for organization
	Tags []string

	// Custom metadata
	Custom map[string]string
}

Metadata contains presentation-level settings

type RenderableSource

type RenderableSource interface {
	ContentSource

	// Render generates visual content (images, HTML) for the segments.
	// outputDir is where rendered files should be written.
	// Returns paths to rendered files indexed by segment ID.
	Render(outputDir string) (map[string]string, error)
}

RenderableSource extends ContentSource for sources that can render visual content.

type TranscriptSource

type TranscriptSource struct {
	// contains filtered or unexported fields
}

TranscriptSource loads content from a transcript JSON file. It supports both slide and browser segments via the sourceType field.

func NewTranscriptSource

func NewTranscriptSource(t *transcript.Transcript) *TranscriptSource

NewTranscriptSource creates a source from a transcript

func NewTranscriptSourceFromFile

func NewTranscriptSourceFromFile(path string) (*TranscriptSource, error)

NewTranscriptSourceFromFile loads a transcript from a JSON file

func (*TranscriptSource) GetFilePath

func (s *TranscriptSource) GetFilePath() string

GetFilePath returns the source file path

func (*TranscriptSource) GetMetadata

func (s *TranscriptSource) GetMetadata() Metadata

GetMetadata returns presentation-level metadata

func (*TranscriptSource) GetTranscript

func (s *TranscriptSource) GetTranscript() *transcript.Transcript

GetTranscript returns the underlying transcript

func (*TranscriptSource) Load

func (s *TranscriptSource) Load() ([]segment.Segment, error)

Load parses the transcript and returns segments

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL