Documentation ¶
Index ¶
- Variables
- func GetTemplateContextHash(templateContext any) string
- func GetTemplateHash(template TemplateDefinition) string
- func SaveStateFile(path string, stateFile StateFile) error
- type Config
- type Cover
- type CoverMeta
- type GradientTemplate
- type GradientTemplateConfig
- type GradientTemplateContext
- type State
- type StateFile
- type TemplateDefinition
Constants ¶
This section is empty.
Variables ¶
View Source
var TemplateDefinitionMap = map[string]TemplateDefinition{}
View Source
var Templates map[string]*template.Template
Functions ¶
func GetTemplateContextHash ¶
func GetTemplateHash ¶
func GetTemplateHash(template TemplateDefinition) string
func SaveStateFile ¶
Types ¶
type Config ¶
type Config struct { OutputPath string `yaml:"output_path,omitempty"` FontPath *string `yaml:"font_path,omitempty"` Covers []Cover `yaml:"covers,omitempty"` }
func LoadConfig ¶
type GradientTemplate ¶
type GradientTemplate struct{}
func (*GradientTemplate) DecodeConfig ¶
func (t *GradientTemplate) DecodeConfig(value *yaml.Node) (any, error)
func (*GradientTemplate) ID ¶
func (t *GradientTemplate) ID() string
func (*GradientTemplate) TemplateContext ¶
func (t *GradientTemplate) TemplateContext(cover Cover) any
type GradientTemplateConfig ¶
type GradientTemplateContext ¶
type GradientTemplateContext struct { GradientTemplateConfig Colour1 string Colour2 string }
type State ¶
func ComputeState ¶
func ComputeState(template TemplateDefinition, cover Cover) State
type StateFile ¶
func LoadStateFile ¶
type TemplateDefinition ¶
type TemplateDefinition interface { // ID returns a unique identifier for the template. // The value should match the filename for the template, without the .svg extension. ID() string // DecodeConfig decodes the config for the template from the given yaml.Node. // The yaml.Node will be a mapping node. DecodeConfig(value *yaml.Node) (any, error) // TemplateContext returns the data to be passed to the template for a given cover. TemplateContext(cover Cover) any }
Click to show internal directories.
Click to hide internal directories.