Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hook ¶
type Hook struct {
Name string
Point HookPoint
Fn func(ctx *HookContext) error
}
Hook is a function called at a specific point in processing.
type HookConfig ¶
type HookConfig struct {
Point string `yaml:"point"`
Command string `yaml:"command"`
Prepend string `yaml:"prepend"`
Append string `yaml:"append"`
Replace []ReplaceRule `yaml:"replace"`
}
HookConfig defines a hook in a YAML plugin file.
type HookContext ¶
type HookContext struct {
FilePath string
Content string
Metadata map[string]interface{}
Theme string
Width int
Format string
}
HookContext provides data to hook functions.
type PluginConfig ¶
type PluginConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Hooks []HookConfig `yaml:"hooks"`
}
PluginConfig represents a YAML plugin definition.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages registered plugin hooks.
func LoadPlugins ¶
LoadPlugins scans configDir for .yaml plugin definitions and registers their hooks.
type ReplaceRule ¶
ReplaceRule defines a string replacement in content.
Click to show internal directories.
Click to hide internal directories.