Documentation
¶
Overview ¶
Package directive parses user input for inline directives like @Image, @File, and @Bash.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Image ImageConfig
RunBash func(ctx context.Context, command string) (string, error)
}
Config holds all directive configuration.
type ImageConfig ¶
ImageConfig holds compression settings for image directives.
type ParsedInput ¶
type ParsedInput struct {
// Text is the input with directive tokens replaced by placeholders.
Text string
// Images holds extracted and compressed images.
Images image.Images
// Warnings holds non-fatal issues (file not found, decode error).
Warnings []string
// Preamble holds prepended context from @File and @Bash expansions.
Preamble string
}
ParsedInput is the result of parsing user input for directives.
func Parse ¶
func Parse(ctx context.Context, input, workdir string, cfg Config) ParsedInput
Parse processes raw user input, expanding all registered directives. The workdir is used to resolve relative paths.
func (ParsedInput) HasImages ¶
func (p ParsedInput) HasImages() bool
HasImages reports whether any images were extracted.
Click to show internal directories.
Click to hide internal directories.