Documentation
¶
Overview ¶
Package theme models lumos theme bundles and loads them from a zip archive (the distributable form) or a directory (handy for authoring).
A bundle contains a theme.yaml manifest with the theme's metadata and variants (each a named palette), plus a programs/ directory in which each file is the config/template for one program. The manifest does not list programs — they are discovered from the files, and each file's name (minus extension) is the registry port key. Files may use ${color.KEY} tokens, filled from the active variant's palette at apply time.
Index ¶
Constants ¶
const Manifest = "theme.yaml"
Manifest is the per-bundle metadata file.
const ProgramsDir = "programs"
ProgramsDir is the bundle subdirectory holding per-program config files.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Program ¶
type Program struct {
// Port is the registry key, taken from the file name without extension.
Port string
// Template is the file body; ${color.KEY} tokens are filled per variant.
Template string
}
Program is one program's config template, discovered from a bundle file.
type Theme ¶
type Theme struct {
Name string
Slug string
Family string
Source string
Description string
Variants []Variant
Programs []Program
// Path is the bundle's zip file or directory.
Path string
}
Theme is a loaded bundle.
func Discover ¶
Discover loads every theme bundle directly under dir: each .zip file, and each subdirectory containing a manifest. Results are sorted by slug. A missing dir yields no themes and no error.
func (Theme) DefaultVariant ¶
DefaultVariant returns the first variant.