theme

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindLatestLocalVersion added in v1.0.1

func FindLatestLocalVersion(themeDir string) (string, error)

FindLatestLocalVersion scans a theme directory and returns the highest semver version found. Falls back to "latest" if only latest.toml exists (backward compatibility). Returns error if no .toml files are found.

Types

type Theme

type Theme struct {
	Author          string
	Name            string
	Version         string // Optional, defaults to "latest"
	VersionExplicit bool   // True if version was explicitly specified in the identifier
}

func ParseIdentifier

func ParseIdentifier(identifier string) (*Theme, error)

ParseIdentifier parses "alice/rainbow@1.2", "alice/rainbow@latest", or "alice/rainbow"

func (*Theme) CacheDir added in v1.0.1

func (t *Theme) CacheDir() (string, error)

CacheDir returns the directory path for this theme (without version file)

func (*Theme) CachePath

func (t *Theme) CachePath() (string, error)

func (*Theme) String

func (t *Theme) String() string

type ValidationResult added in v1.0.0

type ValidationResult struct {
	Valid             bool
	HasCustomCommands bool
	Error             error
}

ValidationResult contains the validation outcome

func ValidateConfig

func ValidateConfig(path string) (ValidationResult, error)

ValidateConfig checks if the TOML is valid and identifies security concerns

func ValidateConfigContent

func ValidateConfigContent(content string) (ValidationResult, error)

ValidateConfigContent validates TOML content and returns validation result Custom commands are detected but NOT blocked - caller decides how to handle

Jump to

Keyboard shortcuts

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