Documentation
¶
Index ¶
- func SaveConfig(persister *inyaml.Persister, config *Config) error
- type BoolVariable
- func (v BoolVariable) Get(path string) (Variable, bool)
- func (v BoolVariable) Keys() []string
- func (v BoolVariable) Len() int
- func (v BoolVariable) MarshalJSON() ([]byte, error)
- func (v *BoolVariable) Set(path string, value Variable) error
- func (v BoolVariable) String() string
- func (v BoolVariable) Type() VariableType
- func (v *BoolVariable) UnmarshalJSON(data []byte) error
- type Config
- type Conversion
- type Engine
- type MapVariable
- func (v MapVariable) Get(path string) (Variable, bool)
- func (v MapVariable) Keys() []string
- func (v MapVariable) Len() int
- func (v MapVariable) MarshalJSON() ([]byte, error)
- func (v *MapVariable) Set(path string, value Variable) error
- func (v MapVariable) String() string
- func (v MapVariable) Type() VariableType
- func (v *MapVariable) UnmarshalJSON(data []byte) error
- type NumberVariable
- func (v NumberVariable) Get(path string) (Variable, bool)
- func (v NumberVariable) Keys() []string
- func (v NumberVariable) Len() int
- func (v NumberVariable) MarshalJSON() ([]byte, error)
- func (v *NumberVariable) Set(path string, value Variable) error
- func (v NumberVariable) String() string
- func (v NumberVariable) Type() VariableType
- func (v *NumberVariable) UnmarshalJSON(data []byte) error
- type Output
- type SliceVariable
- func (v SliceVariable) Get(path string) (Variable, bool)
- func (v SliceVariable) Keys() []string
- func (v SliceVariable) Len() int
- func (v SliceVariable) MarshalJSON() ([]byte, error)
- func (v *SliceVariable) Set(path string, value Variable) error
- func (v SliceVariable) String() string
- func (v SliceVariable) Type() VariableType
- func (v *SliceVariable) UnmarshalJSON(data []byte) error
- type StringVariable
- func (v StringVariable) Get(path string) (Variable, bool)
- func (v StringVariable) Keys() []string
- func (v StringVariable) Len() int
- func (v StringVariable) MarshalJSON() ([]byte, error)
- func (v *StringVariable) Set(path string, value Variable) error
- func (v StringVariable) String() string
- func (v StringVariable) Type() VariableType
- func (v *StringVariable) UnmarshalJSON(data []byte) error
- type Template
- type Variable
- type VariableSet
- func (vs *VariableSet) Flatten() map[string]string
- func (vs *VariableSet) Get(name string) (Variable, bool)
- func (vs *VariableSet) GetByPath(path string) (Variable, bool)
- func (vs *VariableSet) GetString(name string) (string, bool)
- func (vs *VariableSet) GetVariables() map[string]Variable
- func (vs *VariableSet) Keys() []string
- func (vs *VariableSet) Len() int
- func (vs *VariableSet) MarshalJSON() ([]byte, error)
- func (vs *VariableSet) Range(fn func(name string, value Variable) bool)
- func (vs *VariableSet) Set(name string, value Variable)
- func (vs *VariableSet) SetByPath(path string, value Variable) error
- func (vs *VariableSet) UnmarshalJSON(data []byte) error
- type VariableType
- type Variables
- func (v Variables) GetString(path string) (string, bool)
- func (v Variables) MarshalJSON() ([]byte, error)
- func (v Variables) MarshalYAML() (interface{}, error)
- func (v *Variables) SetString(path string, value string) error
- func (v Variables) String() string
- func (v *Variables) UnmarshalJSON(data []byte) error
- func (v *Variables) UnmarshalYAML(value *yaml.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolVariable ¶ added in v1.2.0
type BoolVariable struct {
Value bool
}
BoolVariable represents a boolean variable
func (BoolVariable) Keys ¶ added in v1.2.0
func (v BoolVariable) Keys() []string
func (BoolVariable) Len ¶ added in v1.2.0
func (v BoolVariable) Len() int
func (BoolVariable) MarshalJSON ¶ added in v1.2.0
func (v BoolVariable) MarshalJSON() ([]byte, error)
func (*BoolVariable) Set ¶ added in v1.2.0
func (v *BoolVariable) Set(path string, value Variable) error
func (BoolVariable) String ¶ added in v1.2.0
func (v BoolVariable) String() string
func (BoolVariable) Type ¶ added in v1.2.0
func (v BoolVariable) Type() VariableType
func (*BoolVariable) UnmarshalJSON ¶ added in v1.2.0
func (v *BoolVariable) UnmarshalJSON(data []byte) error
type Config ¶
type Config struct {
Template Template `yaml:"template" json:"template" default:""`
Output Output `yaml:"output" json:"output" default:""`
Variables Variables `yaml:"variables" json:"variables" default:"{}"`
Engine Engine `yaml:"engine" json:"engine" default:"pdflatex"`
Conversion Conversion `yaml:"conversion" json:"conversion"`
Passes int `yaml:"passes" json:"passes" default:"1"`
UseLatexmk bool `yaml:"use_latexmk" json:"use_latexmk" default:"false"`
}
Config defines the YAML configuration schema for AutoPDF
func GetDefaultConfig ¶
func GetDefaultConfig() *Config
GetDefaultConfig returns a default configuration
func NewConfigFromYAML ¶
NewConfigFromYAML creates a new Config from YAML data
type Conversion ¶
type MapVariable ¶ added in v1.2.0
MapVariable represents a map of nested variables
func NewMapVariable ¶ added in v1.2.0
func NewMapVariable() *MapVariable
func (MapVariable) Keys ¶ added in v1.2.0
func (v MapVariable) Keys() []string
func (MapVariable) Len ¶ added in v1.2.0
func (v MapVariable) Len() int
func (MapVariable) MarshalJSON ¶ added in v1.2.0
func (v MapVariable) MarshalJSON() ([]byte, error)
func (*MapVariable) Set ¶ added in v1.2.0
func (v *MapVariable) Set(path string, value Variable) error
func (MapVariable) String ¶ added in v1.2.0
func (v MapVariable) String() string
func (MapVariable) Type ¶ added in v1.2.0
func (v MapVariable) Type() VariableType
func (*MapVariable) UnmarshalJSON ¶ added in v1.2.0
func (v *MapVariable) UnmarshalJSON(data []byte) error
type NumberVariable ¶ added in v1.2.0
type NumberVariable struct {
Value float64
}
NumberVariable represents a numeric variable
func (NumberVariable) Get ¶ added in v1.2.0
func (v NumberVariable) Get(path string) (Variable, bool)
func (NumberVariable) Keys ¶ added in v1.2.0
func (v NumberVariable) Keys() []string
func (NumberVariable) Len ¶ added in v1.2.0
func (v NumberVariable) Len() int
func (NumberVariable) MarshalJSON ¶ added in v1.2.0
func (v NumberVariable) MarshalJSON() ([]byte, error)
func (*NumberVariable) Set ¶ added in v1.2.0
func (v *NumberVariable) Set(path string, value Variable) error
func (NumberVariable) String ¶ added in v1.2.0
func (v NumberVariable) String() string
func (NumberVariable) Type ¶ added in v1.2.0
func (v NumberVariable) Type() VariableType
func (*NumberVariable) UnmarshalJSON ¶ added in v1.2.0
func (v *NumberVariable) UnmarshalJSON(data []byte) error
type SliceVariable ¶ added in v1.2.0
type SliceVariable struct {
Values []Variable
}
SliceVariable represents a slice of variables
func NewSliceVariable ¶ added in v1.2.0
func NewSliceVariable() *SliceVariable
func (SliceVariable) Keys ¶ added in v1.2.0
func (v SliceVariable) Keys() []string
func (SliceVariable) Len ¶ added in v1.2.0
func (v SliceVariable) Len() int
func (SliceVariable) MarshalJSON ¶ added in v1.2.0
func (v SliceVariable) MarshalJSON() ([]byte, error)
func (*SliceVariable) Set ¶ added in v1.2.0
func (v *SliceVariable) Set(path string, value Variable) error
func (SliceVariable) String ¶ added in v1.2.0
func (v SliceVariable) String() string
func (SliceVariable) Type ¶ added in v1.2.0
func (v SliceVariable) Type() VariableType
func (*SliceVariable) UnmarshalJSON ¶ added in v1.2.0
func (v *SliceVariable) UnmarshalJSON(data []byte) error
type StringVariable ¶ added in v1.2.0
type StringVariable struct {
Value string
}
StringVariable represents a simple string variable
func (StringVariable) Get ¶ added in v1.2.0
func (v StringVariable) Get(path string) (Variable, bool)
func (StringVariable) Keys ¶ added in v1.2.0
func (v StringVariable) Keys() []string
func (StringVariable) Len ¶ added in v1.2.0
func (v StringVariable) Len() int
func (StringVariable) MarshalJSON ¶ added in v1.2.0
func (v StringVariable) MarshalJSON() ([]byte, error)
func (*StringVariable) Set ¶ added in v1.2.0
func (v *StringVariable) Set(path string, value Variable) error
func (StringVariable) String ¶ added in v1.2.0
func (v StringVariable) String() string
func (StringVariable) Type ¶ added in v1.2.0
func (v StringVariable) Type() VariableType
func (*StringVariable) UnmarshalJSON ¶ added in v1.2.0
func (v *StringVariable) UnmarshalJSON(data []byte) error
type Variable ¶ added in v1.2.0
type Variable interface {
// String returns the string representation for template substitution
String() string
// Get retrieves a nested value by path (e.g., "foo.bar[0]")
Get(path string) (Variable, bool)
// Set sets a nested value by path
Set(path string, value Variable) error
// Keys returns the keys for map-like variables
Keys() []string
// Len returns the length for slice-like variables
Len() int
// Type returns the variable type
Type() VariableType
// MarshalJSON implements json.Marshaler
MarshalJSON() ([]byte, error)
// UnmarshalJSON implements json.Unmarshaler
UnmarshalJSON(data []byte) error
}
Variable represents a complex variable that can be: - A simple string value - A map of nested variables - A slice of values - Any combination of the above
type VariableSet ¶ added in v1.2.0
type VariableSet struct {
// contains filtered or unexported fields
}
VariableSet represents a collection of variables with complex operations
func NewVariableSet ¶ added in v1.2.0
func NewVariableSet() *VariableSet
func (*VariableSet) Flatten ¶ added in v1.2.0
func (vs *VariableSet) Flatten() map[string]string
FlattenVariables flattens nested variables into dot-notation paths
func (*VariableSet) GetByPath ¶ added in v1.2.0
func (vs *VariableSet) GetByPath(path string) (Variable, bool)
func (*VariableSet) GetString ¶ added in v1.2.0
func (vs *VariableSet) GetString(name string) (string, bool)
func (*VariableSet) GetVariables ¶ added in v1.2.0
func (vs *VariableSet) GetVariables() map[string]Variable
GetVariables returns a copy of the variables map for template processing
func (*VariableSet) Keys ¶ added in v1.2.0
func (vs *VariableSet) Keys() []string
func (*VariableSet) Len ¶ added in v1.2.0
func (vs *VariableSet) Len() int
func (*VariableSet) MarshalJSON ¶ added in v1.2.0
func (vs *VariableSet) MarshalJSON() ([]byte, error)
func (*VariableSet) Range ¶ added in v1.2.0
func (vs *VariableSet) Range(fn func(name string, value Variable) bool)
RangeVariables provides iteration over variables
func (*VariableSet) Set ¶ added in v1.2.0
func (vs *VariableSet) Set(name string, value Variable)
func (*VariableSet) SetByPath ¶ added in v1.2.0
func (vs *VariableSet) SetByPath(path string, value Variable) error
func (*VariableSet) UnmarshalJSON ¶ added in v1.2.0
func (vs *VariableSet) UnmarshalJSON(data []byte) error
type VariableType ¶ added in v1.2.0
type VariableType int
VariableType represents the type of a variable
const ( VariableTypeString VariableType = iota VariableTypeMap VariableTypeSlice VariableTypeNumber VariableTypeBool )
type Variables ¶
type Variables struct {
*VariableSet
}
Variables represents a collection of complex variables
func NewVariables ¶ added in v1.2.0
func NewVariables() *Variables
NewVariables creates a new Variables collection
func (Variables) GetString ¶ added in v1.2.0
GetString gets a string value by path (for backward compatibility)
func (Variables) MarshalJSON ¶ added in v1.2.0
MarshalJSON implements json.Marshaler
func (Variables) MarshalYAML ¶ added in v1.2.0
MarshalYAML implements yaml.Marshaler
func (*Variables) SetString ¶ added in v1.2.0
SetString sets a string value by path (for backward compatibility)
func (*Variables) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON implements json.Unmarshaler